-
Notifications
You must be signed in to change notification settings - Fork 12k
--watch --aot crashes with "JavaScript heap out of memory" and is slow (Beta 5, TypeScript 2.7) #10014
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
We've seen this happen on occasion with Angular 5 as well. Our solution (workaround?) is to run ng serve with the
|
Thank you! It does indeed allow me to build our project using AOT. Given that it's a lot of memory, I'd think this is more a workaround than a solution, but it does the job for now. Thanks again! |
Any fix in angular 6 ? |
This issue has been open for a while now and it seems that the issue happened using an unsupported TypeScript version. While I don't exclude a memory leak, as the application grows you'll need more and more memory to build it, thus using Please update to the most recent Angular CLI version and If the problem persists after upgrading, please open a new issue, provide a simple repository reproducing the problem, and describe the difference between the expected and current behavior. |
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. |
Versions
Your --version command seems to be broken:
But it should be
6.0.0-beta.5
, with the following environment:Repro steps
ng build --watch --aot
[ngClass]
directive to abutton
in my case) and save it.10% building modules 0/1 modules 1 active ...ClientApp\app\app.module.ngfactory.js
during more than 10 minutes (I didn't think to time it, sorry), then crashes.Allocation failed - JavaScript heap out of memory
as a reason.I attempted this three times, today, before reverting to non-AOT builds.
I tried using version 6.0.0-beta.6, but it breaks our project by not finding non-relative
@import
s in our less files, similar as reported here: #10007.Edit: I tried using
ng serve --aot
, and it crashed the same way, but directly at the initial build, not at the incremental build.Observed behavior
Here is my terminal output (with some information redacted with [...]):
Desired behavior
Watch mode should be reliable. It should not crash on incremental builds. It should not take up to 7 minutes to make the initial build (even in AOT) when in development mode. Incremental development builds should be fast.
Mention any other details that might be useful (optional)
Here is the size of our project according to cloc. I don't know if it will be useful, but I guess the project size has an impact on build times, which in turn may be the cause of the crash. I don't know if our project size is above average, or if many people have even larger projects and do not experience similar issues.
The text was updated successfully, but these errors were encountered: