angular-cli: Angular 9.0.4 still gives me build error (Regression??)

🐞 bug report

Affected Package

Still related I think with angular/angular#35709 when running ng build image

Is this a regression?

Was working in 9.0.2

Description

Similar to yesterdays issue with 9.0.3, after updating to 9.0.4, angular won’t build the project anymore.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 4
  • Comments: 19 (4 by maintainers)

Commits related to this issue

Most upvoted comments

@alan-agius4 I confirm this error. It’s the same as #17106 and angular/angular#35709.

I had to delete node_modules and reinstall (with npm ci) to fix the error, which was happening with all the third-party libs except Material.

But while the error is gone, during Ivy compilation on first serve/build, my computer heated as hell (which never happen usually, I have a very recent Macbook Pro). I had to close a process in Monitor Activity to make the heat stop. So it’s seems there is a memory leak somewhere.

This was also happening to me. I macbook pro fans gets angry (literally sounding like a small vacuum cleaner was running inside my mbp) which never happened before during building projects prior to 9.0.4.

Which by the way, I have a beefed up MBP setup.

Have same problem with 9.0.5 and preboot package. I use Angular 9.0.5 and Node 12.10. Clearing of node_modules is not helped.

Compiling preboot : es2015 as esm2015
Compiling preboot : module as esm5

<--- Last few GCs --->

[85873:0x10280c000]   162112 ms: Mark-sweep 2045.4 (2051.0) -> 2044.9 (2051.3) MB, 1419.3 / 0.0 ms  (average mu = 0.086, current mu = 0.001) allocation failure scavenge might not succeed
[85873:0x10280c000]   163455 ms: Mark-sweep 2045.6 (2051.3) -> 2045.1 (2051.5) MB, 1340.4 / 0.0 ms  (average mu = 0.044, current mu = 0.001) allocation failure scavenge might not succeed

<--- JS stacktrace --->

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x1009288f9]
Security context: 0x196d5afc0919 <JSObject>
    1: parseMappings(aka parseMappings) [0x196d188c7e91] [/path_to_proj/node_modules/@angular/compiler-cli/ngcc/src/sourcemaps/source_file.js:~270] [pc=0x2c7b297e04c1](this=0x196da4b004d1 <undefined>,0x196d80f16a59 <Object map = 0x196dc9f558f9>,0x196d80f16f39 <JSArray[1]>)
    2: /* anonymous */(aka /* anonymous */) [0x196de305a309] [/...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

And I got the same for angular-draggable-droppable package as well.

==== JS stack trace =========================================

    0: ExitFrame [pc: 0x1009288f9]
    1: StubFrame [pc: 0x10092a5c2]
    2: StubFrame [pc: 0x10090825e]
Security context: 0x30ba420c0919 <JSObject>
    3: split [0x30ba420ccf49](this=0x30ba27d14049 <Very long string[9647]>,0x30ba27d14069 <JSRegExp <String[#5]: \r?\n>>)
    4: computeLineLengths(aka computeLineLengths) [0x30ba84847ff1] [/path_to_proj/node_modules/@angular/compiler-cli/ngcc/src/sourcemaps/source_f...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

I got it with Angular 9.0.5. With Angular 9.0.2 all works fine.

just confirming deleting node_modules and doing npm install fixes this for me, my machine still sounds like a jet engine, but node doesn’t nope out anymore

Your memory is getting out of heap during the build add ‘node --max_old_space_size=5120 ./node_modules/@angular/cli/bin/ng build --prod’ to package.json script

This only happens with Angular 9.0.4

Rolling back to Angular 9.0.2 ng build and ng serve runs with no errors.