Repository navigation
ng build --aot fails #4043
Description
Please provide us with the following information:
OS?
Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
OS X El Capitan
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
angular-cli: 1.0.0-beta.25.5
node: 6.7.0
os: darwin x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/material: 2.0.0-beta.1
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
If I run ng build --aot it throws an error after it logs the bundles that were created.
The log given by the failure.
Normally this include a stack trace and some more information.
Hash: f623b656056e9a59a302
Time: 14288ms
chunk {0} scripts.b070e2134bb20fc4e5f5.bundle.js (scripts) 730 kB {4} [initial] [rendered]
chunk {1} styles.fe1bc11c112063cca818.bundle.css (styles) 21.9 kB {4} [initial] [rendered]
chunk {2} main.3269aa95e662115bc916.bundle.js (main) 1.97 kB {3} [initial] [rendered]
chunk {3} vendor.9340472a0450b55ed1fe.bundle.js (vendor) 1.08 MB [initial] [rendered]
chunk {4} inline.a6aa1cbd561bcc42ae6c.bundle.js (inline) 0 bytes [entry] [rendered]
ERROR in providers.forEach is not a function
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/rolandjitsu/Projects/infarm/dashboard/src'
@ ./src/main.ts 4:0-74
@ multi main
ERROR in ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js
Module not found: Error: Can't resolve '/Users/rolandjitsu/Projects/infarm/dashboard/src/$$_gendir' in '/Users/rolandjitsu/Projects/infarm/dashboard/node_modules/@angular/core/src/linker'
@ ./~/@angular/core/src/linker/system_js_ng_module_factory_loader.js 69:15-36 85:15-102
@ ./~/@angular/core/src/linker.js
@ ./~/@angular/core/src/core.js
@ ./~/@angular/core/index.js
@ ./src/main.ts
@ multi main
Mention any other details that might be useful.
Thanks! We'll be in touch soon.
Activity
filipesilva commentedon Jan 16, 2017
It looks like the real error is
ERROR in providers.forEach is not a functionwhen then breaks the AoT'dapp.module. Can you show me the code of./src/app/app.module.ts?rolandjitsu commentedon Jan 16, 2017
Yes I can:
Shinzah commentedon Jan 16, 2017
Could you show your angular-cli.json ?
is app.assets an array ?
rolandjitsu commentedon Jan 16, 2017
@Shinzah It is an array, yes. But I cannot see how that would have any impact on AOT.
I do know that I get an error if I add a folder or file that does not exist in the
{apps: [{assets: []}]}, but as I said previously, it's a completely different error.Splaktar commentedon Jan 18, 2017
I get the same thing but without the
ERROR in providers.forEach is not a functionand no other message in its place.rolandjitsu commentedon Feb 28, 2017
I found the issue. It seems like AOT does not like:
But it works with:
angular-automatic-lock-bot commentedon Sep 21, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.