Skip to content

ng build --aot fails #4043

@rolandjitsu

Description

@rolandjitsu

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 --version and 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions