Skip to content

Library importing another library's module results in build error #14164

@atodd-geoplan

Description

@atodd-geoplan

🐞 Bug report

Command (mark with an x)

- [ ] new
- [x ] build
- [ ] serve
- [ ] test
- [ ] e2e
- [ ] generate
- [ ] add
- [ ] update
- [ ] lint
- [ ] xi18n
- [ ] run
- [ ] config
- [ ] help
- [ ] version
- [ ] doc

Is this a regression?

Not for me - new workspace

Description

When importing a module from one library into a module of another library, using either the public-api, the distribution folder or relative paths will trigger a build error when building the library that is doing the import

ng build two

Also, the error is cryptic and had to trial and error to find the culprit.

🔬 Minimal Reproduction

Create a workspace with a new app and two libraries.
Import library two's module into library one's.
Build library one.

see: https://github.com/alastair-todd/ng-cli-lib-bug

🔥 Exception or Error


BUILD ERROR
Could not resolve entry (F:\_dev\ng-work\dist\two\esm2015\two.js)
Error: Could not resolve entry (F:\_dev\ng-work\dist\two\esm2015\two.js)
    at error (F:\_dev\ng-work\node_modules\rollup\dist\rollup.js:3460:30)
    at F:\_dev\ng-work\node_modules\rollup\dist\rollup.js:21474:17

Could not resolve entry (F:\_dev\ng-work\dist\two\esm2015\two.js)
Error: Could not resolve entry (F:\_dev\ng-work\dist\two\esm2015\two.js)
    at error (F:\_dev\ng-work\node_modules\rollup\dist\rollup.js:3460:30)
    at F:\_dev\ng-work\node_modules\rollup\dist\rollup.js:21474:17

🌍 Your Environment


Angular CLI: 7.3.8
Node: 10.13.0
OS: win32 x64
Angular: 7.2.13
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                            Version
------------------------------------------------------------
@angular-devkit/architect          0.13.8
@angular-devkit/build-angular      0.13.8
@angular-devkit/build-ng-packagr   0.13.8
@angular-devkit/build-optimizer    0.13.8
@angular-devkit/build-webpack      0.13.8
@angular-devkit/core               7.3.8
@angular-devkit/schematics         7.3.8
@angular/cli                       7.3.8
@ngtools/json-schema               1.1.0
@ngtools/webpack                   7.3.8
@schematics/angular                7.3.8
@schematics/update                 0.13.8
ng-packagr                         4.7.1
rxjs                               6.3.3
typescript                         3.2.4
webpack                            4.29.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions