1

Azure Angular build is failing with -

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

We tried - npm run build:ssr --max-old-space-size=1024 m but it didn't work. We did try setting different sizes.

Here's the complete error:

2019-06-02T04:27:51.2432150Z [command]C:\windows\system32\cmd.exe /D /S /C "C:\npm\prefix\npm.cmd run build:ssr"
2019-06-02T04:31:03.6579570Z FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
2019-06-02T04:31:03.6580213Z  1: 00007FF675FAF04A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+5114
2019-06-02T04:31:03.6580271Z  2: 00007FF675F8A0C6 node::MakeCallback+4518
2019-06-02T04:31:03.6580376Z  3: 00007FF675F8AA30 node_module_register+2032
2019-06-02T04:31:03.6580421Z  4: 00007FF6762120EE v8::internal::FatalProcessOutOfMemory+846
2019-06-02T04:31:03.6580464Z  5: 00007FF67621201F v8::internal::FatalProcessOutOfMemory+639
2019-06-02T04:31:03.6580573Z  6: 00007FF676732BC4 v8::internal::Heap::MaxHeapGrowingFactor+9556
2019-06-02T04:31:03.6580676Z  7: 00007FF676729C46 v8::internal::ScavengeJob::operator=+24310
2019-06-02T04:31:03.6580721Z  8: 00007FF67672829C v8::internal::ScavengeJob::operator=+17740
2019-06-02T04:31:03.6580764Z  9: 00007FF676730F87 v8::internal::Heap::MaxHeapGrowingFactor+2327
2019-06-02T04:31:03.6580880Z 10: 00007FF676731006 v8::internal::Heap::MaxHeapGrowingFactor+2454
2019-06-02T04:31:03.6580923Z 11: 00007FF6762ECDB7 v8::internal::Factory::NewFillerObject+55
2019-06-02T04:31:03.6580965Z 12: 00007FF676382CC6 v8::internal::WasmJs::Install+29414
2019-06-02T04:31:03.6581005Z 13: 000002DF3095C5C1 
2019-06-02T04:31:03.6581101Z npm ERR! code ELIFECYCLE
2019-06-02T04:31:03.6581140Z npm ERR! errno 134
2019-06-02T04:31:03.6581185Z npm ERR! futek-ui@0.0.0 build:client-and-server-bundles: `ng build --prod && ng run FutekUI:server`
2019-06-02T04:31:03.6581285Z npm ERR! Exit status 134
2019-06-02T04:31:03.6581327Z npm ERR! 
2019-06-02T04:31:03.6581371Z npm ERR! Failed at the futek-ui@0.0.0 build:client-and-server-bundles script.
2019-06-02T04:31:03.6581417Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-06-02T04:31:03.6581502Z 
2019-06-02T04:31:03.6581545Z npm ERR! A complete log of this run can be found in:
2019-06-02T04:31:03.6582900Z npm ERR!     C:\npm\cache\_logs\2019-06-02T04_31_03_522Z-debug.log
2019-06-02T04:31:03.6582942Z npm ERR! code ELIFECYCLE
2019-06-02T04:31:03.6583053Z npm ERR! errno 134
2019-06-02T04:31:03.6583101Z npm ERR! futek-ui@0.0.0 build:ssr: `npm run build:client-and-server-bundles && npm run webpack:server`
2019-06-02T04:31:03.6583142Z npm ERR! Exit status 134
2019-06-02T04:31:03.6583233Z npm ERR! 
2019-06-02T04:31:03.6583275Z npm ERR! Failed at the futek-ui@0.0.0 build:ssr script.
2019-06-02T04:31:03.6583321Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-06-02T04:31:03.6583489Z 
2019-06-02T04:31:03.6583584Z npm ERR! A complete log of this run can be found in:
2019-06-02T04:31:03.6583613Z 
2019-06-02T04:31:03.6583938Z npm ERR!     C:\npm\cache\_logs\2019-06-02T04_31_03_584Z-debug.log
2019-06-02T04:31:03.6584033Z > futek-ui@0.0.0 build:ssr D:\a\1\s\FutekUI
2019-06-02T04:31:03.6584078Z > npm run build:client-and-server-bundles && npm run webpack:server
2019-06-02T04:31:03.6584115Z 
2019-06-02T04:31:03.6584140Z
barbsan
  • 3,238
  • 11
  • 18
  • 27
kkumar
  • 11
  • 2

1 Answers1

2

For me this error was solved by adding the following variable to my linked variable group (Library). Alternatively you can add it as individual Pipeline variable in your build pipeline:

Name: NODE_OPTIONS
Value: --max_old_space_size=16384

All variables defined in your build pipeline or linked library will be exported as environment variables.

veuncent
  • 1,089
  • 1
  • 13
  • 15