Node.js Memory Allocation Failure in Latest Version

Resolved 💬 12 comments Opened Mar 12, 2025 by olgeni Closed Mar 15, 2025

Bug Description
When starting on most projects, this comes up (using the latest version):

<--- Last few GCs --->

[5155:0x128008000]     5760 ms: Mark-Compact (reduce) 4094.3 (4107.5) -> 4094.1 (4100.5) MB, pooled: 0 MB, 4.83 / 0.00 ms  (+ 0.1 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 14 ms) (average mu = 0.945, curren[5155:0x128008000]     5780 ms: Mark-Compact (reduce) 4104.3 (4110.7) -> 4104.2 (4110.7) MB, pooled: 0 MB, 11.12 / 0.00 ms  (+ 0.0 ms in 0 steps since start of marking, biggest step 0.0 ms, walltime since start of marking 14 ms) (average mu = 0.858, curre

<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory

----- Native stack trace -----

 1: 0x102cc77c0 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
 2: 0x102e713f4 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
 3: 0x10302e424 v8::internal::Heap::CallGCPrologueCallbacks(v8::GCType, v8::GCCallbackFlags, v8::internal::GCTracer::Scope::ScopeId) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
 4: 0x10302ba80 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
 5: 0x102fcfcdc v8::internal::StackGuard::HandleInterrupts(v8::internal::StackGuard::InterruptLevel) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
 6: 0x1032d9358 v8::internal::Runtime_StackGuardWithGap(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
 7: 0x102abb9f4 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/23.9.0/bin/node]
 8: 0x102a25ec0 Builtins_MaglevFunctionEntryStackCheck_WithoutNewTarget [/opt/homebrew/Cellar/node/23.9.0/bin/node]
 9: 0x10b2c9218
10: 0x10b289160
11: 0x102a61e20 Builtins_AsyncFunctionAwaitResolveClosure [/opt/homebrew/Cellar/node/23.9.0/bin/node]
12: 0x102b2f298 Builtins_PromiseFulfillReactionJob [/opt/homebrew/Cellar/node/23.9.0/bin/node]
13: 0x102a51214 Builtins_RunMicrotasks [/opt/homebrew/Cellar/node/23.9.0/bin/node]
14: 0x102a223f0 Builtins_JSRunMicrotasksEntry [/opt/homebrew/Cellar/node/23.9.0/bin/node]
15: 0x102fa331c v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
16: 0x102fa3a88 v8::internal::(anonymous namespace)::InvokeWithTryCatch(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
17: 0x102fce03c v8::internal::MicrotaskQueue::PerformCheckpointInternal(v8::Isolate*) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
18: 0x102bdd5e4 node::InternalCallbackScope::Close() [/opt/homebrew/Cellar/node/23.9.0/bin/node]
19: 0x102bddb94 node::InternalMakeCallback(node::Environment*, v8::Local<v8::Object>, v8::Local<v8::Object>, v8::Local<v8::Function>, int, v8::Local<v8::Value>*, node::async_context, v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
20: 0x102bf5d90 node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
21: 0x102ccda00 node::fs::FSReqCallback::Resolve(v8::Local<v8::Value>) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
22: 0x102ccf390 node::fs::AfterNoArgs(uv_fs_s*) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
23: 0x102cbe130 node::MakeLibuvRequestCallback<uv_fs_s, void (*)(uv_fs_s*)>::Wrapper(uv_fs_s*) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
24: 0x10641214c uv__work_done [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
25: 0x106415a74 uv__async_io [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
26: 0x10642601c uv__io_poll [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
27: 0x106415f08 uv_run [/opt/homebrew/Cellar/libuv/1.50.0/lib/libuv.1.dylib]
28: 0x102bde488 node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
29: 0x102d0ef10 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
30: 0x102d0ec64 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/23.9.0/bin/node]
31: 0x102c8827c node::Start(int, char**) [/opt/homebrew/Cellar/node/23.9.0/bin/node]
32: 0x18c6ac274 start [/usr/lib/dyld]

Environment Info

  • Platform: macos
  • Terminal: iTerm.app
  • Version: 0.2.37
  • Feedback ID: 185b32d4-7d22-4505-b103-940844ae5640

Errors

[{"error":"TypeError: path must not be empty\n    at Cw3 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:299:7897)\n    at nA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:299:8005)\n    at IJ2._test (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:299:8609)\n    at IJ2.ignores (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:299:9110)\n    at wJ2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:570:229)\n    at Hw3 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:568:404)\n    at Object.call (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:568:109)\n    at call.next (<anonymous>)\n    at AN (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:570:367)\n    at file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:583:893","timestamp":"2025-03-12T07:06:23.501Z"}]

Version 0.2.36 does not show this behavior ☺️

View original on GitHub ↗

This issue has 12 comments on GitHub. Read the full discussion on GitHub ↗