-
Notifications
You must be signed in to change notification settings - Fork 12k
CLI10: got a few compiler crashes today with "JavaScript heap out of memory" #18034
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
Same situation on my personal project which has been created in v10 (not upgrade from v9).
UPDATE I've updated Node.js to v14 but it isn't be solved. |
I can confirm that node.exe for @ngtools/webpack/src/type_checker_worker.js is growing roughly by a few MB on every single file save/recompile cycle. It went OOM for me after updating to Angular 10 within an hour or so... Its pretty annoying that This can easily be reproduced by just saving a file without modifications in VSCode. I just hammered CTRL+S a few dozen times. After a while I see this: After that |
Most likely this is related to a regression in the compiler which was fixed via angular/angular#37641 and will be available in 10.0.1 JFYI @alxhub |
I was able to fix this by downgrading the
(might need to delete or update Any version above
|
It's still happening after upgrading to v10.0.1 but Its frequency is a little down on my environment. We still need more effective fixes. |
The fix is due to come out in 10.1.x as per @alan-agius4 . So lets wait for it or use workarounds as pointed out by me or @AXeL-dev |
@PPInfy, the fix is was referring too, is included in 10.0.1. @lacolaco, we’ll still continue looking at other possible issues and resolutions. Nb: using an older version of build-angular might cause undefined behaviour. Angular and Angular CLI version 10 needs |
@alan-agius4 I thought since the issue is open and based on your comment this will come in release 10.1.0 to be precise. |
@PPInfy, sorry I missed a |
I'm getting this same error but while running "ng update @angular/core @angular/cli" on a very complex ng9 project. I am using @angular/compiler 10.0.1. |
try running node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng serve or |
@PPInfy - If that comment was directed at me, I updated my comment for clarify. I'm getting the error when running the update command, not 'after' on build like I originally said. |
Try "node --max_old_space_size=2048 ./node_modules/@angular/cli/bin/ng update @angular/core @angular/cli" |
@PPInfy - When I try that I get the following output:
|
Quick update: We've identified the memory leak in Ivy compiler, and we're currently working on a fix. It'll be out in v10.0.2. |
v10.0.2 is out! I'll close this issue for now. Please open a new issue if you run into other memory issues. |
@kyliau - I am still getting the out of memory error but it is on the 'update' command instead of on build. Do you want me to create a new issue? |
@AlphaCreative-Mike yes please create a new issue. It'll help us triage and prioritize the issue if you open a new one. Thank you! |
Still getting the exact same issue using 10.0.2:
Using
|
Same issue for me as well. <--- JS stacktrace ---> ==== JS stack trace =========================================
Security context: 0x013eeb49e6e9 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory |
For me the issue got solved by changing "target": "es6" from "target": "es5" in tsconfig.json. However I do have a question. Will this change work in IE11?. And can we do the change to es6? Will it break anything? |
For anyone still seeing issues, it's probably caused by the same issue as reported in #18087. This is being addressed in #18089 that's expected to be in the next release, which should be released over the course of today. For people using Yarn, you can add a |
does it change with target as es6? Because I tried many times switching between target es5 and es6 and everytime there is no build/server issue with target as es6 (tsconfig.json -> compilerOptions--> target). |
Anyone else's team dead in the water until this releases? |
Update worked fine for me, after the update the leak seems gone, processes are growing and shrinking again in a "normal" way I guess :) Only thing observed, incremental build times are way slower now - like 5 seconds instead of 1 second before... |
@mduft are you using tsconfig.json -> compilerOptions--> target as ES6 ? |
@PPInfy we have |
@mduft that is nothing but es6. with target es6/es2015 this is working touchwood. So again this seems like a compiler issuer rather than packager (not an issue with webpack or related modules it looks like) issue. Can someone here confirm this? |
@alan-agius4 - Please test the fixes with target as es5. I think the root cause might be related to that. |
@PPInfy, what’s the output of |
For me it is:
Note the 10.0.1 versions of all the packages... |
@mduft After which update did you see to start the incremental rebuild time regression? I am trying to figure out if it's due to a change in Angular framework or the CLI. Investigating this without a reproduction is practically impossible I'm afraid, so is it possible to share a reproduction? |
Angular CLI: 10.0.1 Angular: 10.0.2 Package Version@angular-devkit/architect 0.1000.1 With this also same situation - OOM. |
Again with Target ES6 it is working absolutely fine. |
I thought it was easy to repro using this project - this commit has the update to 10.0.2 - however switching back to the commit before, it now also takes longer than usual :| |
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. |
🐞 Bug report
Command (mark with an
x
)Is this a regression?
Yes, the previous version in which this bug was not present was Angular 9 with CLI 9.
Description
Small project freshly migrated from ng9 to 10, I sometimes get a compiler crash with "JavaScript heap out of memory" during ng serve.
It never happened to me before ng 10.
Project is available here:
https://github.com/ldex/Angular-Academy-202
🔥 Exception or Error
🌍 Your Environment
Anything else relevant?
The text was updated successfully, but these errors were encountered: