-
Notifications
You must be signed in to change notification settings - Fork 12k
I can't build AOT and the error is giving me nothing? #5294
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Hi @borntodesign , This seemed to have been a problem last month due to users not deleting all of their @angular-cli references. Could you please ensure you run:
Within your app folder, also what version of ts are you using? |
Hi @RicardoVaranda , I Still see this error which doesn't say much. |
Hi all, I'm having the same issue ERROR in Cannot read property 'text' of undefined ERROR in ./src/main.ts @angular/cli: 1.0.0-rc.2 |
@RicardoVaranda I actually have since copied it into a completely fresh angular-cli project and still no joy? |
In my case I have just
with no explanation on what the problem is |
Just upgraded to @angular/cli: 1.0.0-rc.2 My project builds and runs fine with:
However, these break:
I'm not sure exactly what -prod or --target=production trigger (AOT?) but the build results in this error:
SearchInputComponent is the first declared and exported Component in a shared module. |
Why everyone here has at least an error and I don't have anyhting? :D |
In my case I solved by removing |
I had a dummy file from a previous implementation where we used ngrx. After I've removed the file it's working again. |
If you can provide a simple repro we can investigate. |
Today, I was able to build fine with However, I do get the error with the latest version of the AotPlugin and on a basic app:
Module not found: Error: Can't resolve '../aot/app/app.module.ngfactory' I don't know in which version it started to break. |
So I think there's probably a few different bugs going on in this issue, but I have a repro for the error that @florinbardosi originally got in a repo at https://github.com/ycros/angular-aot-cryptic-error-repro - in my case it's including a dependency that I guess is incompatible with AOT in some way, and the actual bug is that the error needs to be clearer. |
I've also got a missleading "Can't resolve './$$_gendir/app/app.module.ngfactory'" - Error Message when building AOT. The reason was that I've accidentally deleted one of our sourcefiles called "spinner.service" and I've referenced this file in one of our components and passing it to the constructor by injection
which of course gives an error. Compiling JIT gives the correct error, compiling AOT the missleading "ngFactory" error... When compiling AOT I get the following missleading error ("XXX" is the path to our "(...)/src/app" - folder)
When compiling JIT, I get the correct error message:
|
@alex88 , thanks for the tip. Removing the --bail shows me the real errors. |
@hansl it seems the really problematic issue here is how AOT reports an inscrutable error while non-AOT reports something that is actionable (see @Btruckses comment). Can you take a look at why this happens? |
+1 |
Hey @hansl is there another ticket where this is being more actively investigated or is this on hold? AOT reporting with the ngfactory can be quite difficult to decipher. |
Can you reproduce this issue with the latest CLI? If this is still valid, would you provide a minimal demo where we can reproduce the problem? |
Closing the issue due to inactivity. If the problem still exists in the latest version of the CLI, please open a new issue following the template and providing a minimal demo where we can reproduce it. Thanks! :-) |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
$ ng build -prod --aot
Hash: d230164e916b758d0692
Time: 18475ms
chunk {0} polyfills.c55f89f35c48bf2c6e88.bundle.js (polyfills) 153 kB {5} [initial] [rendered]
chunk {1} scripts.4df4da6c643df8224363.bundle.js (scripts) 750 kB {5} [initial] [rendered]
chunk {2} styles.bd44f3c52773890a1208.bundle.css (styles) 281 bytes {5} [initial] [rendered]
chunk {3} main.daff98269318dace91c3.bundle.js (main) 668 bytes {4} [initial] [rendered]
chunk {4} vendor.094b768043954986be41.bundle.js (vendor) 834 kB [initial] [rendered]
chunk {5} inline.4a76813170987b826954.bundle.js (inline) 0 bytes [entry] [rendered]
ERROR in Maximum call stack size exceeded
ERROR in ./src/main.ts
Module not found: Error: Can't resolve './$$_gendir/app/app.module.ngfactory' in '/Users/baypublishing/projects/vvink/src'
@ ./src/main.ts 4:0-74
@ multi ./src/main.ts
@angular/cli: 1.0.0-rc.1
node: 6.9.2
os: darwin x64
@angular/common: 2.4.9
@angular/compiler: 2.4.9
@angular/core: 2.4.9
@angular/forms: 2.4.9
@angular/http: 2.4.9
@angular/platform-browser: 2.4.9
@angular/platform-browser-dynamic: 2.4.9
@angular/router: 3.4.9
@angular/cli: 1.0.0-rc.1
@angular/compiler-cli: 2.4.9
I even created a new project and copied over but no joy?
The text was updated successfully, but these errors were encountered: