-
Notifications
You must be signed in to change notification settings - Fork 12k
AoT Freezes #2515
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
I had the exact same percentage stopping point in one of my repos. Just out of curiosity are you pulling in Material2 or do you have images in your application that are directly referenced in the templates / css? |
I was able to replicate this issue by pulling in material2 into a cleanly generated cli app. I am experiencing the same issue with an internal component library, so this doesn't seem to be an issue with material2 itself.
|
Hi, not material2, but I am using ng2-bootstrap, but I'm including the css in my styles.scss files. I'm not sure if ng2-bootstrap is including anything else... Richard |
Another interesting note, removing the import of material2 from the application both |
@zackarychapple I experienced the same issue with angular-cli beta.16 when pulling in material2 alpha9-3. If I run
|
Hmm, I also got a new exception when running
For the record, my
|
Just tried with the updated beta-17, same issue...
EDIT |
I have upgraded the project project I used as a reference in my comment above from I ended up experiencing a few different issues instead. I will review other already open aot related issues to see if and where they fit. Just for a brief reference:
|
Just one more brief comment re: item 1 above. The mentioned compile time errors can be fixed by adding 'spurious' imports of the missing names (interfaces, classes or the like.) They are spurious in that they are not explicitly required in the module for which the error is thrown. This implies TSLint warnings of unused names in turn, but at least it compiles. |
@tomwanzek I'm glad to hear you managed to get some progress. We'll investigate the remaining issues. |
Experiencing the same issue as @Richard87. Do you have any progress on this? Using beta.17. |
Any update on this? I am also receiving "HomeModule is not an NgModule |
I'll add another: My main error is "null is not an ngModule" and apparently caused by css-loader:
EDIT: Turns out that the css-loader error goes away whenever I remove any styles (including styles.css) from angular-cli.json. The AOT compiler probably has issues with modules loaded from that file. |
@naveedahmed1 @drager I may have a solution. I think you're missing the @NgModule decorator and metadata on the routing modules. I took two steps (below) to solve my problem. They basically amount to following the official Angular routing guide (https://angular.io/docs/ts/latest/guide/router.html) religiously - apparently, it changed a bit from 2.0 to 2.1.
For example:
|
@FoodBuster: Yeah, I have a setup like this. Problem was not that though. When I run |
Updating to beta.18 and doing a 'ng init' update resolved this issue for me. |
After alot of changes, I got a step closer (ngc -p works, and I have upgraded all the code pr the documentation), the only thing I have not done is configure rollup.js... Now when I run ng serve --aot (no matter which configuration build/prod etc) I get this error message:
Now this file exists: |
@FoodBuster thank you for the suggestion it did fix the errors and compilation seems to complete without any error. But the dist folder has just inline, main and style bundle, there are around 23 .map files but no other javascript bundle. Running the app for the generated files throws below error "EXCEPTION: Uncaught (in promise): Error: Cannot find module 'app/home/home.module.ngfactory'" Any suggestions? |
@naveedahmed1 Are you using lazy loading? As far as I know, AOT + lazy loading doesn't work yet in angular-cli-generated projects (and it's the big issue the cli team is working on). AOT requires a .ngfactory file for each ngModule, but the --aot flag only generates the .ngfactory file for the root module. We might just need to wait for a cli update on this one. |
I have seen few posts which says the AoT works with Angular CLI, Can you please tell me is there any difference between the lazy loading routes that we generate when using systemjs and the lazy loading routes that we generate when using webpack? |
@naveedahmed1 Unfortunately, I don't know if there's a difference. I'm on the webpack cli. On the aot and lazy loading issue, check #2735 for updates. |
@FoodBuster thanks for pointing that out. I was banging my head why I couldn't get it to work. @team please be more descriptive in error messages. |
@FoodBuster thx for the hint. This solves the problem with X Module is not a NgModule |
@elvirdolic I did not understand how you actually solved this issue. Can you explain? |
"Convert all routing files to ngModules. Previously, I had routing files that exported routes but didn't contain all the ngModule metadata." this is what I have done. |
@elvirdolic Thanks. Unfortunately, I already have this coding style in place, but still getting trouble with AoT and lazy routes. |
lazy routes and AOT are not supported in the latest release. This task 2016-11-10 12:35 GMT+01:00 unsafecode [email protected]:
|
@elvirdolic In the end I managed to solve this issue as well, but as you said, lazy routes and AoT simply don't play together. I also tried out the master branch, but much like the hidden |
For me, |
Closing this, it's been fixed a while ago. |
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 serve --aot
freezes after compiling 85 modules.OS?
Versions.
ng --version
angular-cli: 1.0.0-beta.16
node: 6.3.0
os: win32 x64
Repro steps.
started with RC4 (created with angular-cli) and upgraded to final (2.0.1)
The log given by the failure.
Freezes:
ng serve --aot
** NG Live Development Server is running on http://localhost:4200. **
20% building modules 85/85 modules 0 active
The text was updated successfully, but these errors were encountered: