angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

AOT build fails

Open adwd opened this issue 9 years ago • 173 comments

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Versions.

    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.2.3
node: 6.11.1
os: darwin x64
@angular/animations: 4.3.1
@angular/common: 4.3.1
@angular/compiler: 4.3.1
@angular/core: 4.3.1
@angular/forms: 4.3.1
@angular/http: 4.3.1
@angular/platform-browser: 4.3.1
@angular/platform-browser-dynamic: 4.3.1
@angular/router: 4.3.1
@angular/cli: 1.2.3
@angular/compiler-cli: 4.3.1
@angular/language-service: 4.3.1

Repro steps.

$ ng new hello
$ cd hello
$ ng build --prod

The log given by the failure.

$ ng build --prod
Hash: edf6fb3ccb1b82fa940c
Time: 10775ms
chunk    {0} polyfills.71b130084c52939ca448.bundle.js (polyfills) 177 kB {4} [initial] [rendered]
chunk    {1} main.e81f19d3f6b27a436c79.bundle.js (main) 1.09 kB {3} [initial] [rendered]
chunk    {2} styles.d41d8cd98f00b204e980.bundle.css (styles) 69 bytes {4} [initial] [rendered]
chunk    {3} vendor.f7457d5ac1e9743fd76f.bundle.js (vendor) 849 kB [initial] [rendered]
chunk    {4} inline.18e445e37a0efd4dcfa2.bundle.js (inline) 0 bytes [entry] [rendered]

ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in 'hello/src'
 @ ./src/main.ts 3:0-74
 @ multi ./src/main.ts

Desired functionality.

aot build runs

Mention any other details that might be useful.

Maybe, enhanced-resolve 3.4.0 is cause. https://github.com/webpack/enhanced-resolve/issues/98

ng build --prod runs successfully after npm i [email protected] .

adwd avatar Jul 24 '17 10:07 adwd

I noticed same problem and after npm i [email protected] I can build with AOT

mchmielarski avatar Jul 24 '17 10:07 mchmielarski

Same problem here

MasDevProject avatar Jul 24 '17 10:07 MasDevProject

@mchmielarski That's a very nice guess 👍

serhiisol avatar Jul 24 '17 10:07 serhiisol

Same here. workaround: npm install [email protected]

zucker-rdrg avatar Jul 24 '17 10:07 zucker-rdrg

thanks for the solution guys, this problem just cost us the whole morning. adding [email protected] solved it.

jahller avatar Jul 24 '17 10:07 jahller

Thx, same here. [email protected] solved the issue.

ChrisCherryfarmer avatar Jul 24 '17 10:07 ChrisCherryfarmer

The same here!

[email protected] solved it!

kondi0 avatar Jul 24 '17 11:07 kondi0

thanks god for this issue, i fixed this problem the whole day

hpyou avatar Jul 24 '17 11:07 hpyou

Workaround with "[email protected]" seems to work on Mac OS but not on Linux!? Can anyone confirm this behavior?

thegitty avatar Jul 24 '17 11:07 thegitty

works on linux ubuntu 16.04 for me

sculeb avatar Jul 24 '17 11:07 sculeb

Same issue.

TautvydasDerzinskas avatar Jul 24 '17 11:07 TautvydasDerzinskas

Guys, you should really use fixed dependency versions for Angular-Cli. It's been a millionth time when everything breaks because in new versions of sub dependencies there is something unexpected...

TautvydasDerzinskas avatar Jul 24 '17 12:07 TautvydasDerzinskas

The angular-cli version is already fixed for us which is 1.3.1 but still we have this error.

cankayacan avatar Jul 24 '17 12:07 cankayacan

Same issue for me. Resolved with [email protected] on Ubuntu Server.

RIP the first 2 hours of my morning.

bmcswee avatar Jul 24 '17 12:07 bmcswee

It worked for me too with 3.3.0.

erashu212 avatar Jul 24 '17 13:07 erashu212

Still we have error in AOT even with 3.4.1. Also in development the environment.ts is not overwritten with the appropriate environment file

amiram avatar Jul 24 '17 13:07 amiram

This breaks all builds, amazing fun was had today! PLZ PLZ PLZ move to fixed dependency.

webmutation avatar Jul 24 '17 13:07 webmutation

Issue still exists with [email protected] here. Same issue showing up. Staying at 3.3.0 for now.

tkoenig89 avatar Jul 24 '17 13:07 tkoenig89

When creating new project with fresh installed angular/cli 1.2.0 fails, too :( I used yarn for package management.

Pittan avatar Jul 24 '17 14:07 Pittan

Same problem here. npm install [email protected] resolved the issue for me temporarily, but only when it's installed as an addition into an already up and running project. Deployment through a fresh install with npm install with this dependency set in package.json does not work.

This is a major bug, because it breaks a running deployment pipeline and with it the whole production setup.

pvanhemmen avatar Jul 24 '17 14:07 pvanhemmen