gatsby: fail to run gatsby build

Preliminary Checks

Description

I am working on macOS11.4,16G RAM. I am using the gatsby@3.x. When run npm run build in local,it occurs this error:

success onPostBuild - 0.017s
⠧ Caching JavaScript and CSS webpack compilation
⠏ Caching HTML renderer compilation

<--- Last few GCs --->

[3183:0x1046b8000]   216764 ms: Mark-sweep 4081.0 (4107.1) -> 4077.6 (4107.6) MB, 2318.2 / 2.1 ms  (average mu = 0.087, current mu = 0.003) allocation failure scavenge might not succeed
[3183:0x1046b8000]   219074 ms: Mark-sweep 4081.6 (4107.6) -> 4078.1 (4107.6) MB, 2303.4 / 1.9 ms  (average mu = 0.047, 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: 0x1012b7fd5 node::Abort() (.cold.1) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
 2: 0x1000a3fa9 node::Abort() [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
 3: 0x1000a410f node::OnFatalError(char const*, char const*) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
 4: 0x1001e57f7 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
 5: 0x1001e5793 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
 6: 0x100383775 v8::internal::Heap::FatalProcessOutOfMemory(char const*) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
 7: 0x10038523a v8::internal::Heap::RecomputeLimits(v8::internal::GarbageCollector) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
 8: 0x100380909 v8::internal::Heap::PerformGarbageCollection(v8::internal::GarbageCollector, v8::GCCallbackFlags) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
 9: 0x10037e1a1 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
10: 0x10038ca3a v8::internal::Heap::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
11: 0x10038cac1 v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
12: 0x10035a487 v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
13: 0x1006d8758 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
14: 0x100a4faf9 Builtins_CEntry_Return1_DontSaveFPRegs_ArgvOnStack_NoBuiltinExit [/Users/luhc228/.nvm/versions/node/v14.6.0/bin/node]
[1]    3182 abort      npm run build

Reproduction Link

https://github.com/luhc228/aitechlab-site/pull/1

Steps to Reproduce

  1. npm install
  2. npm run build

Expected Result

gatsby build successfully

Actual Result

has GC error

Environment

node@14.6.0
npm@6.14.13
macOS@11.4

Config Flags

No response

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 18 (2 by maintainers)

Most upvoted comments

Hi!

Since we didn’t receive an answer for 7 days or more about the ask of a reproduction I’m going to close this now, as we can’t do much to help without a reproduction. If you are able to create a minimal reproduction for this then please do answer here or open a new issue with a reproduction. Thanks!