This is a reproduction repo for a "Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class" problem, which shows when using npm link
(such as when using lerna).
Angular github issue: #35447
- checkout the repo
npm install
ng build lib1 --prod && ng build --prod
(builds correctly)cd projects/lib1 && npm link && cd ../.. && npm link lib1
ng build lib1 --prod && ng build --prod
(fails)
These are the steps used to create this repo:
ng new import-not-resolved-repro
cd import-not-resolved-repro
ng generate library lib1
- modify
src/app/app.module.ts
to loadLib1Module
fromlib1