FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
I was using npm version 8.1.1 and node version 17.0.1. Then I tried downgrading to versions 7.24.2 for npm and 14.18.1 LTS for node, but I still get the same error.
[7432:000001F15002D0F0] 193144 ms: Mark-sweep (reduce) 2037.2 (2051.1) -> 2036.8 (2052.4) MB, 3731.7 / 0.1 ms (average mu = 0.141, current mu = 0.017) allocation failure scavenge might not succeed
[7432:000001F15002D0F0] 196878 ms: Mark-sweep (reduce) 2038.0 (2054.4) -> 2037.6 (2055.1) MB, 3724.3 / 0.1 ms (average mu = 0.080, current mu = 0.003) allocation failure scavenge might not succeed
<--- JS stacktrace --->
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
1: 00007FF684FE412F napi_wrap 133311
2: 00007FF684F7DD06 SSL_get_quiet_shutdown 63062
3: 00007FF684F7EB9D node::OnFatalError 301
4: 00007FF6858619CE v8::Isolate::ReportExternalAllocationLimitReached 94
5: 00007FF6858467BD v8::SharedArrayBuffer::Externalize 781
6: 00007FF6856EFFCC v8::internal::Heap::EphemeronKeyWriteBarrierFromCode 1516
7: 00007FF6856FB3EA v8::internal::Heap::ProtectUnprotectedMemoryChunks 1258
8: 00007FF6856F8529 v8::internal::Heap::PageFlagsAreConsistent 2457
9: 00007FF6856ED0C1 v8::internal::Heap::CollectGarbage 2049
10: 00007FF6856EB2C5 v8::internal::Heap::AllocateExternalBackingStore 1349
11: 00007FF68570B73B v8::internal::Factory::NewFillerObject 203
12: 00007FF685439F81 v8::internal::interpreter::JumpTableTargetOffsets::iterator::operator= 1409
13: 00007FF6858ECDFD v8::internal::SetupIsolateDelegate::SetupHeap 474253
14: 00007FF6858EDCAD v8::internal::SetupIsolateDelegate::SetupHeap 478013
15: 00007FF68593DE89 v8::internal::SetupIsolateDelegate::SetupHeap 806169
16: 00007FF6858DC792 v8::internal::SetupIsolateDelegate::SetupHeap 407074
17: 0000031867B4B9AC ```
CodePudding user response:
The solution that has worked for me is adding a .env
file in the same directory as package.json
and adding GENERATE_SOURCEMAP=false
into the .env
file.
see this for reference https://create-react-app.dev/docs/advanced-configuration/