Title: Dual app has duplicate declarations error only with AOT · Issue #6189 · angular/angular-cli · GitHub
Open Graph Title: Dual app has duplicate declarations error only with AOT · Issue #6189 · angular/angular-cli
X Title: Dual app has duplicate declarations error only with AOT · Issue #6189 · angular/angular-cli
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/...
Open Graph 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/for...
X 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/...
Opengraph URL: https://github.com/angular/angular-cli/issues/6189
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Dual app has duplicate declarations error only with AOT","articleBody":"\u003c!--\r\nIF YOU DON'T FILL OUT THE FOLLOWING INFORMATION YOUR ISSUE MIGHT BE CLOSED WITHOUT INVESTIGATING\r\n-->\r\n```\r\n- [x] bug report -> please search issues before submitting\r\n```\r\n\r\n### Versions.\r\n```\r\n@angular/cli: 1.0.2\r\nnode: 7.5.0\r\nos: darwin x64\r\n@angular/common: 4.1.1\r\n@angular/compiler: 4.1.1\r\n@angular/core: 4.1.1\r\n@angular/forms: 4.1.1\r\n@angular/http: 4.1.1\r\n@angular/platform-browser: 4.1.1\r\n@angular/platform-browser-dynamic: 4.1.1\r\n@angular/router: 4.1.1\r\n@angular/cli: 1.0.2\r\n@angular/compiler-cli: 4.1.1\r\n```\r\n\u003c!--\r\nOutput from: `ng --version`.\r\nIf nothing, output from: `node --version` and `npm --version`.\r\n Windows (7/8/10). Linux (incl. distribution). macOS (El Capitan? Sierra?)\r\n-->\r\n\r\n\r\n### Repro steps.\r\nI created a [repo](https://github.com/zackarychapple/dualApp) that replicates this issue. \r\n\r\n1. Create Second app in `.angular-cli.json` with unique main file.\r\n1. Create Duplicate of `app.module.ts` and name it `app2.module.ts\r\n1. Run `ng build` everything works as expected\r\n1. Run `ng build --prod --aot` and get the below error:\r\n\r\n### The log given by the failure.\r\n```\r\nERROR 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.\r\n\r\nERROR in ./src/main.ts\r\nModule not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/zchapple/code/test/src'\r\n @ ./src/main.ts 4:0-74\r\n @ multi ./src/main.ts\r\n```\r\n\r\n### Desired functionality.\r\nExpected behavior is that the apps should be evaluated independently for duplicate module AOT checks. \r\n\r\n\r\n","author":{"url":"https://github.com/zackarychapple","@type":"Person","name":"zackarychapple"},"datePublished":"2017-05-05T02:12:53Z","url":"https://github.com/angular/angular-cli/issues/6189"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:535e689c-86a3-4b30-176d-e1ce6938d524 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E172:30B4F6:1FB87E6:2A0341A:6B057350 |
| html-safe-nonce | 0cd5651becb66746c212cbdf8f818a00f04e443fc3a7f9280b81aadfde26c0d2 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMTcyOjMwQjRGNjoxRkI4N0U2OjJBMDM0MUE6NkIwNTczNTAiLCJ2aXNpdG9yX2lkIjoiNDUxMDEwNzI4NjMwMzUwMzE4NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 02898b1ad6fed5bf7c136ad3607a0f051f0604ee8354810273a0dc75a60afb0a |
| hovercard-subject-tag | issue:226456072 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/6189/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9798a6bd7d79cf413a7b042071e6e5c7f1e244843c286b6792ef80cd8de88490/angular/angular-cli/issues/6189 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9798a6bd7d79cf413a7b042071e6e5c7f1e244843c286b6792ef80cd8de88490/angular/angular-cli/issues/6189 |
| og:image:alt | - [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/for... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | zackarychapple |
| hostname | github.com |
| expected-hostname | github.com |
| None | 507b2d62524c0f595c35a2a2ee8a6ec54b119f245b3c59eaa070013b70ed1ada |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | e7a883ae3b439b8952652eaa7803e2587f30e339 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width