Netlify cli bug not attended to in Github

There has been a reported bug for several versions now of netlify-cli amongst more than myself.

Reported as requested in the produced error from the following:

netlify dev

The Github issues tracker has specifics, but the error reporting runs away and the only way to stop it is to kill the process.

So far with each incremental version since 22.2.0 more than one error report submitted has had no response.

Can you please provide some visibility on awareness of this issue and an indication that there is someone attending to it?

PLEASE help us help you by writing a good post!

  • We need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot
  • Did you try Ask Netlify, our generative AI chatbot, before posting? It pulls info from Support Guides and recent solved forums posts.

The better the post - the faster the answer.

Mind sharing a reproduction repo?

That’d be a bit tricky as I’d have to copy a private repo, create a new repo and make sure there’s nothing proprietary in it.

The project itself is at: rad-cranachan-eb757b

I wonder if that helps at all to reprouce?

Also, if I let netlify dev error out forever (several minutes), it finally crashes with this stacktrace. Perhaps this helps?

Given it’s affecting a single user (you), the only way to debug would be to check your project as there could be something specifically in that project that could trigger this. If this doesn’t happen in a minimal reproduction outside of your project, there’s no way we can debug this as we don’t know the specific condition that’s causing it.

I’m also not seeing any stacktrace in your post.



 ›   Error: Netlify CLI has terminated unexpectedly
This is a problem with the Netlify CLI, not with your application.
If you recently updated the CLI, consider reverting to an older version by running:

npm install -g netlify-cli@VERSION

You can use any version from https://ntl.fyi/cli-versions.

Please report this problem at https://ntl.fyi/cli-error including the error details below.


<--- Last few GCs --->

[5797:0x158008000]   267531 ms: Mark-Compact 4022.9 (4136.9) -> 4008.4 (4138.1) MB, pooled: 0 MB, 4257.83 / 0.00 ms  (average mu = 0.131, current mu = 0.076) allocation failure; scavenge might not succeed
[5797:0x158008000]   274489 ms: Mark-Compact 4024.2 (4138.1) -> 4009.7 (4139.6) MB, pooled: 0 MB, 6589.92 / 0.00 ms  (average mu = 0.083, current mu = 0.053) allocation failure; scavenge might not succeed


<--- JS stacktrace --->

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

 1: 0x1021b91fc node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
 2: 0x1023e4704 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
 3: 0x1025ce9a4 v8::internal::Heap::stack() [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
 4: 0x1025e3928 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_8::operator()() const [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
 5: 0x1025e31f4 void heap::base::Stack::SetMarkerAndCallbackImpl<v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags)::$_8>(heap::base::Stack*, void*, void const*) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
 6: 0x102d29c34 PushAllRegistersAndIterateStack [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
 7: 0x1025ccbd0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
 8: 0x1025c1aec v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
 9: 0x1025c2328 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
10: 0x102595eec v8::internal::FactoryBase<v8::internal::Factory>::NewRawOneByteString(int, v8::internal::AllocationType) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
11: 0x1028c1bf0 v8::internal::String::SlowFlatten(v8::internal::Isolate*, v8::internal::Handle<v8::internal::ConsString>, v8::internal::AllocationType) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
12: 0x1023fcf60 v8::String::WriteUtf8(v8::Isolate*, char*, int, int*, int) const [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
13: 0x1022def98 void node::MakeUtf8String<char>(v8::Isolate*, v8::Local<v8::Value>, node::MaybeStackBuffer<char, 1024ul>*) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
14: 0x1022df014 node::Utf8Value::Utf8Value(v8::Isolate*, v8::Local<v8::Value>) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
15: 0x1022c0a54 node::(anonymous namespace)::ProcessWrap::Spawn(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
16: 0x102d970f4 Builtins_CallApiCallbackOptimizedNoProfiling [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
17: 0x10990daa0 
18: 0x109a20290 
19: 0x102d94ef0 Builtins_InterpreterEntryTrampoline [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
20: 0x102d94ef0 Builtins_InterpreterEntryTrampoline [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
21: 0x102d94ef0 Builtins_InterpreterEntryTrampoline [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
22: 0x10992065c 
23: 0x109918fc4 
24: 0x1099244d0 
25: 0x109b950b8 
26: 0x10990bb30 
27: 0x109913c54 
28: 0x102d92c0c Builtins_JSEntryTrampoline [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
29: 0x102d928f4 Builtins_JSEntry [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
30: 0x10252a728 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
31: 0x10252a06c v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
32: 0x1023fae8c v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
33: 0x1021ba540 node::errors::TriggerUncaughtException(v8::Isolate*, v8::Local<v8::Value>, v8::Local<v8::Message>, bool) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
34: 0x1021bb25c node::errors::TriggerUncaughtException(v8::FunctionCallbackInfo<v8::Value> const&) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
35: 0x102d970f4 Builtins_CallApiCallbackOptimizedNoProfiling [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
36: 0x10990c5e4 
37: 0x109ba4174 
38: 0x102d92c0c Builtins_JSEntryTrampoline [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
39: 0x102d928f4 Builtins_JSEntry [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
40: 0x10252a728 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
41: 0x10252a06c v8::internal::Execution::Call(v8::internal::Isolate*, v8::internal::Handle<v8::internal::Object>, v8::internal::Handle<v8::internal::Object>, int, v8::internal::Handle<v8::internal::Object>*) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
42: 0x1023fae8c v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
43: 0x1020d5a6c node::InternalCallbackScope::Close() [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
44: 0x1020d5cac 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>) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
45: 0x1020eaafc node::AsyncWrap::MakeCallback(v8::Local<v8::Function>, int, v8::Local<v8::Value>*) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
46: 0x10215143c node::(anonymous namespace)::FSEventWrap::OnEvent(uv_fs_event_s*, char const*, int, int) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
47: 0x102d84d60 uv__fsevents_cb [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
48: 0x102d72900 uv__async_io [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
49: 0x102d862f4 uv__io_poll [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
50: 0x102d72e98 uv_run [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
51: 0x1020d64e4 node::SpinEventLoopInternal(node::Environment*) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
52: 0x102200628 node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
53: 0x1022003c4 node::NodeMainInstance::Run() [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
54: 0x102176f88 node::Start(int, char**) [/Users/julian/.nvm/versions/node/v22.13.0/bin/node]
55: 0x186d36b98 start [/usr/lib/dyld]
[1]    5797 abort      netlify dev

There are others besides me who have this issue according to the Issue tracker, it’s just that neither issue seems to have been assigned nor attended to while new versions of the CLI are introduced.

Julian

While creating a minimal repository, I took the repo that produces the issue, cloned it, detached it from Git and the remote by removing the .git directory.

The netlify dev command did not produce an error.

Then I did a simple git init (not attached to the original repository)

And the netlify dev command produced the error (run-away process).

Here is a screenflow of this interaction: ➨ https://www.dropbox.com/scl/fi/lr86hiyq7o604ryea1h0j/netlify-issues_001.mp4?rlkey=29rwjqp5ri5enynqh2kflweg2&dl=0

When the process is killed (kill -9 PID), this stack trace is left behind:

Perhaps some bad interactions between netlify and git?


› Error: Netlify CLI has terminated unexpectedly
This is a problem with the Netlify CLI, not with your application.
If you recently updated the CLI, consider reverting to an older version by running:

npm install -g netlify-cli@VERSION

You can use any version from https://ntl.fyi/cli-versions.

Please report this problem at https://ntl.fyi/cli-error including the error details below.

fatal error: all goroutines are asleep - deadlock!
[1] 34029 killed netlify dev

goroutine 1 [chan receive]:
github.com/evanw/esbuild/internal/helpers.(*ThreadSafeWaitGroup).Wait(...)
github.com/evanw/esbuild/internal/helpers/waitgroup.go:36
main.runService.func2()
github.com/evanw/esbuild/cmd/esbuild/service.go:114 +0x88
main.runService(0x1)
github.com/evanw/esbuild/cmd/esbuild/service.go:160 +0x47c
main.main()
github.com/evanw/esbuild/cmd/esbuild/main.go:250 +0xaa0

goroutine 21 [chan receive]:
main.runService.func1()
github.com/evanw/esbuild/cmd/esbuild/service.go:98 +0x40
created by main.runService in goroutine 1
github.com/evanw/esbuild/cmd/esbuild/service.go:97 +0x19c

goroutine 22 [chan receive]:
main.(*serviceType).sendRequest(0x1400012a990, {0x101146700, 0x1400096c180})
github.com/evanw/esbuild/cmd/esbuild/service.go:192 +0x138
main.runService.func3()
github.com/evanw/esbuild/cmd/esbuild/service.go:125 +0x44
created by main.runService in goroutine 1
github.com/evanw/esbuild/cmd/esbuild/service.go:122 +0x2e4

goroutine 29 [chan receive]:
github.com/evanw/esbuild/internal/bundler.(*scanner).scanAllDependencies(0x140004fa908)
github.com/evanw/esbuild/internal/bundler/bundler.go:2098 +0x1cc
github.com/evanw/esbuild/internal/bundler.ScanBundle(_, {_, _, _, _, _, _}, {_, _}, _, ...)
github.com/evanw/esbuild/internal/bundler/bundler.go:1426 +0x87c
github.com/evanw/esbuild/pkg/api.rebuildImpl({0x14000496060, {0x0, 0x0, 0x0}, {0x0, 0x0, 0x0}, {0xa, 0x1, 0x2, ...}, ...}, ...)
github.com/evanw/esbuild/pkg/api/api_impl.go:1480 +0x1f8
github.com/evanw/esbuild/pkg/api.(*internalContext).rebuild(_)
github.com/evanw/esbuild/pkg/api/api_impl.go:998 +0x2cc
github.com/evanw/esbuild/pkg/api.(*internalContext).Rebuild(...)
github.com/evanw/esbuild/pkg/api/api_impl.go:1059
github.com/evanw/esbuild/pkg/api.Build({0x2, 0x4, 0xa, 0x140004840c0, 0x2, {0x140002066ce, 0x47}, 0x0, 0x0, {0x1400048a000, ...}, ...})
github.com/evanw/esbuild/pkg/api/api.go:387 +0x74
main.(*serviceType).handleBuildRequest(0x1400012a990, 0x6, 0x1400012b0e0)
github.com/evanw/esbuild/cmd/esbuild/service.go:782 +0xc14
main.(*serviceType).handleIncomingPacket.func2()
github.com/evanw/esbuild/cmd/esbuild/service.go:235 +0x58
created by main.(*serviceType).handleIncomingPacket in goroutine 1
github.com/evanw/esbuild/cmd/esbuild/service.go:233 +0x1ac

goroutine 119 [chan receive]:
main.(*serviceType).sendRequest(0x1400012a990, {0x101146700, 0x14000584750})
github.com/evanw/esbuild/cmd/esbuild/service.go:192 +0x138
main.(*serviceType).convertPlugins.func2.3({{0x14000a8fcb8, 0x5}, {0x14000791380, 0x60}, {0x101009cba, 0x4}, {0x14000791380, _}, _, {_, ...}, ...})
github.com/evanw/esbuild/cmd/esbuild/service.go:997 +0x7c4
github.com/evanw/esbuild/pkg/api.(*pluginImpl).onResolve.func1({{0x14000a8fcb8, 0x5}, {0x14000791380, 0x57}, {0x0, 0x0}, {{0x14000791380, 0x60}, {0x101009cba, 0x4}, ...}, ...})
github.com/evanw/esbuild/pkg/api/api_impl.go:1920 +0x1a4
github.com/evanw/esbuild/internal/bundler.RunOnResolvePlugins({0x140004960c0?, 0x0?, 0x0?}, 0x140004fa488, {0x140004fc000, 0x1400048a1e0, 0x1400048a1f8, 0x1400048e0c0, 0x4, 0x140004841e0}, ...)
github.com/evanw/esbuild/internal/bundler/bundler.go:1010 +0x690
github.com/evanw/esbuild/internal/bundler.parseFile({{0x1011cfc00, 0x1400048e0e0}, {0x140004fc000, 0x1400048a1e0, 0x1400048a1f8, 0x1400048e0c0, 0x4, 0x140004841e0}, 0x140004fa488, 0x14000496060, ...})
github.com/evanw/esbuild/internal/bundler/bundler.go:520 +0x290c
created by github.com/evanw/esbuild/internal/bundler.(*scanner).maybeParseFile in goroutine 29
github.com/evanw/esbuild/internal/bundler/bundler.go:1549 +0xa0c
(base)
~/Code/netlify-test-astro/nfl-backoffice on  main! ⌚ 9:11:23 ```

You can try specifying --debug flag to see if you get any additional info. Usually, this will also enable the framework’s debug logs. The stacktrace just shows a JavaScript Garbage Collection OOM and doesn’t really help.

I also noticed you’re using Neon and the Emails integration. Have you tried without those?

Hello

So — I spent more than an entire working day (I can get a bit caught in a rabbit hole) rebuilding the repo (website) that produces the Netlify spin crash error we’ve been discussing.

I effectively did that file by file and piece by piece. At some point, the error was introduced so I thought I was isolating a problematic file. Note that the file in question in all instances were just static assets — images, which are a large component of my blog.

But, what I discovered was that this was non-deterministic. I could only imagine that there was an issue with a static file — but what might it be? Its size? It wasn’t corrupted in any fashion, and even if it was — we’re just serving static assets so corruption might only mean that it would appear broken or some such.

In any case, if I remove the file, the site might not crash when running netlify dev, as I could remove it — and see the site build fine, then add it back to confirm it was the issue..and the site would build fine. Then I could continue, still quite confused, and come across something else that would cause netlify dev to crash, and again it would be non-deterministic, as if netlify dev crashing had nothing to do with the file itself, but just being run again and deciding that it was going to crash.

I have to say, with many hours trying to recreate the issue — there is something broken in a problematic way with netlify cli. The only thing I can think to do is run netlify cli in a debugger.

But, right now — I’ll just stick to 22.2.0 and hope you find a reproducible repository to identify the issue.

If I find the time to again pursue recreating the problematic repository, I will certainly provide it. Right now, the fact that the issue occurs seemingly without a deterministic cause, I’m not sure that’s of value to tracking things down (it might not occur on your end, for example.)

Maybe a step in the right direction would be to assign someone properly to the issue in Github, assuming that’s why Netlify has asked people to post issues. Maybe even pause for a moment and start after some of these bugs.

Julian