Closed
Description
- [x] bug report -> please search issues before submitting
Versions.
@angular/cli: 1.0.2
node: 7.5.0
os: darwin x64
@angular/common: 4.1.1
@angular/compiler: 4.1.1
@angular/core: 4.1.1
@angular/forms: 4.1.1
@angular/http: 4.1.1
@angular/platform-browser: 4.1.1
@angular/platform-browser-dynamic: 4.1.1
@angular/router: 4.1.1
@angular/cli: 1.0.2
@angular/compiler-cli: 4.1.1
Repro steps.
I created a repo that replicates this issue.
- Create Second app in
.angular-cli.json
with unique main file. - Create Duplicate of
app.module.ts
and name it `app2.module.ts - Run
ng build
everything works as expected - Run
ng build --prod --aot
and get the below error:
The log given by the failure.
ERROR in Type AppComponent in /Users/zchapple/code/test/src/app/app.component.ts is part of the declarations of 2 modules: AppModule in /Users/zchapple/code/test/src/app/app.module.ts and AppModule in /Users/zchapple/code/test/src/app/app2.module.ts! Please consider moving AppComponent in /Users/zchapple/code/test/src/app/app.component.ts to a higher module that imports AppModule in /Users/zchapple/code/test/src/app/app.module.ts and AppModule in /Users/zchapple/code/test/src/app/app2.module.ts. You can also create a new NgModule that exports and includes AppComponent in /Users/zchapple/code/test/src/app/app.component.ts then import that NgModule in AppModule in /Users/zchapple/code/test/src/app/app.module.ts and AppModule in /Users/zchapple/code/test/src/app/app2.module.ts.
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/zchapple/code/test/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
Desired functionality.
Expected behavior is that the apps should be evaluated independently for duplicate module AOT checks.
Metadata
Metadata
Assignees
Labels
No labels