Open Closed

Fatal Error when trying to build angular project to publish on IIS #7343


0
nathaliewehbe created

Hello,

I am facing a problem on ng build --prod , the error is in the following, any solution?

92% chunk asset optimization TerserPlugin <--- Last few GCs --->

[15616:000002217CD8AFF0] 233725 ms: Mark-sweep 1282.4 (1455.6) -> 1282.4 (1451.6) MB, 1375.6 / 0.0 ms (average mu = 0.143, current mu = 0.121) allocation failure GC in old space requested [15616:000002217CD8AFF0] 234498 ms: Mark-sweep 1282.4 (1451.6) -> 1282.1 (1449.6) MB, 772.8 / 0.0 ms (average mu = 0.091, current mu = 0.000) allocation failure GC in old space requested

<--- JS stacktrace --->

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

0: ExitFrame [pc: 00000365CE55C5C1]

Security context: 0x0144a739e6e9


3 Answer(s)
  • 0
    ismcagdas created

    Hi,

    Increasing the memory used by node might help, see https://github.com/angular/angular-cli/issues/5618#issuecomment-449624730

  • 0
    nathaliewehbe created

    Hi,

    I tried to add the following to package.json but did not resolver the issue.

    "scripts": { "ng": "ng", "build-prod": "node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng build --prod", "publish": "ng build --prod", "start": "ng serve --host 0.0.0.0 --port 4200", "hmr": "ng serve --host 0.0.0.0 --port 4200 --hmr", "test": "ng test", "pree2e": "webdriver-manager update --standalone false --gecko false", "e2e": "protractor" },

    ** Error:** 13% building 27/36 modules 9 active ...gular\src\app\shared\layout\layout.less <--- Last few GCs --->

    [1924:000002A3DD1DD150] 50357 ms: Mark-sweep 2021.0 (2077.4) -> 2011.1 (2081.1) MB, 415.4 / 0.0 ms (average mu = 0.306, current mu = 0.244) allocation failure scavenge might not succeed [1924:000002A3DD1DD150] 51308 ms: Mark-sweep 2024.2 (2081.6) -> 2013.9 (2081.9) MB, 779.5 / 0.0 ms (average mu = 0.235, current mu = 0.180) allocation failure scavenge might not succeed

    <--- JS stacktrace --->

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

    0: ExitFrame [pc: 00007FF61DF1170D]
    

    Security context: 0x0132c7000911

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

    Writing Node.js report to file: report.20190722.091250.1924.0.001.json Node.js report completed 1: 00007FF61D6D962F napi_wrap+122319 2: 00007FF61D682376 public: bool __cdecl v8::base::CPU::has_sse(void)const __ptr64+34454 3: 00007FF61D683036 public: bool __cdecl v8::base::CPU::has_sse(void)const __ptr64+37718 4: 00007FF61DE68A1E private: void __cdecl v8::Isolate::ReportExternalAllocationLimitReached(void) __ptr64+94 5: 00007FF61DE50D6A public: class v8::SharedArrayBuffer::Contents __cdecl v8::SharedArrayBuffer::Externalize(void) __ptr64+842 6: 00007FF61DCE256C public: static void __cdecl v8::internal::Heap::EphemeronKeyWriteBarrierFromCode(unsigned __int64,unsigned __int64,class v8::internal::Isolate * __ptr64)+1436 7: 00007FF61DCEA48F public: unsigned __int64 __cdecl v8::internal::Heap::OldGenerationSizeOfObjects(void) __ptr64+4879 8: 00007FF61DCE0733 public: bool __cdecl v8::internal::Heap::CollectGarbage(enum v8::internal::AllocationSpace,enum v8::internal::GarbageCollectionReason,enum v8::GCCallbackFlags) __ptr64+1235 9: 00007FF61DCDEFC4 public: void __cdecl v8::internal::Heap::AddRetainedMap(class v8::internal::Handle

  • 0
    alper created

    Run

    npm run ng-high-memory -- build --prod