The build step fails
cindyli opened this issue · comments
Cindy Qi Li commented
Describe the bug
The Netlify build for the WeCount website has been failing since August. The reported Error is:
8:32:56 PM: <--- Last few GCs --->
8:32:56 PM: [8646:0x6020bf0] 83544 ms: Mark-sweep 4040.6 (4137.0) -> 4027.7 (4140.8) MB, 1053.6 / 0.0 ms (average mu = 0.314, current mu = 0.039) allocation failure scavenge might not succeed
8:32:56 PM: [8646:0x6020bf0] 84654 ms: Mark-sweep 4044.0 (4140.8) -> 4031.0 (4144.3) MB, 1061.0 / 0.0 ms (average mu = 0.197, current mu = 0.044) allocation failure scavenge might not succeed
8:32:56 PM: <--- JS stacktrace --->
8:32:56 PM: FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
8:32:56 PM: 1: 0xb090e0 node::Abort() [node]
8:32:56 PM: 2: 0xa1b70e [node]
8:32:56 PM: 3: 0xce1a20 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [node]
8:32:56 PM: 4: 0xce1dc7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [node]
8:32:56 PM: 5: 0xe99435 [node]
8:32:56 PM: 6: 0xea90fd v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [node]
8:32:56 PM: 7: 0xeabdfe v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [node]
8:32:56 PM: 8: 0xe6d33a v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [node]
8:32:56 PM: 9: 0x11e61e6 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [node]
8:32:56 PM: 10: 0x15d9e59 [node]
8:32:58 PM: Aborted (core dumped)
8:32:58 PM: ERROR: build:eleventy exited with 134.
To Reproduce
Login Netlify and check the build status, the build step has been failing since a month ago.
Steps to reproduce the behavior locally:
- Run
npm run build
ornpm start
- All fail with "Javascript heap out of memory" error.
Expected behavior
The build step should pass.
Solution
Setting the Netlify environment variable NODE_OPTIONS=”–max-old-space-size=4096”
doesn't help. See the discussion about this solution here.
As the build also fails locally without Netlify, the eleventy suggested solution that runs the eleventy
command with --max-old-space-size=6000
fixed the problem.