cli icon indicating copy to clipboard operation
cli copied to clipboard

Error: Netlify CLI has terminated unexpectedly (latest versions since 22.2.0)

Open bleeckerj opened this issue 4 months ago • 9 comments

Describe the bug

Non-stop error repeating very quickly and forever. This has occurred since version 22.2.0.

"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

This repeats forever until I kill VS Code.

Image

Steps to reproduce

Update Netlify via

npm i -g netlify-cli

Configuration

netlify.toml

[[headers]] for = "/" [headers.values] Access-Control-Allow-Origin = "" [[plugins]] package = "@netlify/plugin-emails" [[redirects]] from = "/projects/ghostwriter" to = "/projects/2025/artificial-intelligence-designed-fictions-research-studio/ghostwriter/" status = 301 [[redirects]]
from = "/projects/2025/ai-designed-fictions-research-studio/vibewriter-web-edition" to = "/projects/2025/artificial-intelligence-designed-fictions-research-studio/vibewriter-web-edition/" status = 301 [functions] external_node_modules = ["@sendgrid/mail"] [dev] framework = "astro"

Environment

$ npx envinfo --system --binaries --npmPackages netlify-cli --npmGlobePackages netlify-cli

System: OS: macOS 15.6 CPU: (8) arm64 Apple M2 Memory: 94.11 MB / 16.00 GB Shell: 5.9 - /bin/zsh Binaries: Node: 22.13.0 - ~/.nvm/versions/node/v22.13.0/bin/node Yarn: 1.22.22 - /usr/local/bin/yarn npm: 11.3.0 - ~/.nvm/versions/node/v22.13.0/bin/npm pnpm: 9.8.0 - /usr/local/bin/pnpm bun: 1.2.2 - ~/.nvm/versions/node/v22.13.0/bin/bun npmPackages: netlify-cli: ^22.3.0 => 22.3.0

bleeckerj avatar Aug 06 '25 21:08 bleeckerj

Bump.

Still occurring at the latest version of netlify-cli

What exactly are you guys doing to mitigate this error?

Paying Netlify customer here wants to know.

bleeckerj avatar Aug 14 '25 15:08 bleeckerj

  • It seems as though the issue does not occur if one is running netlify dev in a directory that is not a Git repo.

Here are two stack traces. The first is if the process runs itself out. The second is if netlify dev is killed (-9) and the process ends up spitting up a stack trace.

Both of these remarks indicate to me that netlify and esbuild are not playing well together.

It may still be a peculiarity with my repository, but the indicator that removing the .git from the directory results in a good run from netlify dev seems to suggest otherwise, particularly as version 22.2.0 of netlify works fine.

 ›   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

and one after a kill -9

 ›   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) 

bleeckerj avatar Aug 19 '25 18:08 bleeckerj

@bleeckerj Any progress here?

treyg avatar Oct 09 '25 00:10 treyg

No but I’m planning to run netlify in another lldb debug process soon when I have some headroom.Anything on your end?Julian Bleecker, BSEE, MSEng, PhDnearfuturelaboratory.comPortfoliojulianbleecker.comGeneral Seminargeneralseminar.comthe near future laboratory podcastpodcasts.apple.com/us/podcast/near-future-laboratory/omata.cominstagram.com/omataOn Oct 8, 2025, at 17:42, Trey Gordon @.***> wrote:treyg left a comment (netlify/cli#7539) @bleeckerj Any progress here?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

bleeckerj avatar Oct 09 '25 01:10 bleeckerj

@bleeckerj Not yet, unfortunately. I'm hoping to look into it more deeply when I get the time as well. Interesting that it doesn't happen in a non-git connected repo.

treyg avatar Oct 09 '25 16:10 treyg

Ran into this as well with nothing obvious as to the cause - downgrading to 22.2.2 and it works.

benlavalley avatar Nov 23 '25 21:11 benlavalley

@benlavalley — do you have a repo you can share that causes this issue? Unfortunately mine is not public othewise I'd share it with Netlify. In any case, I spent a day with a fork of my repo trying to isolate the problem, but the results were non-deterministic, by which I mean I could get to a point where the error was not happening, but I could not repeat the problem when I tried again, and the error would occur at other points. Not sure what's going on here but a bit concerned that at some point the older version won't be supported. Right now I'm looking into other hosting as Netlify does not seem to be tracking the issue closely.

bleeckerj avatar Nov 24 '25 20:11 bleeckerj

Hi folks. Sorry for the silence here. Unfortunately there isn't much to go on here at the moment as we haven't been able to reproduce this on our end.

Some further details from any of you may prove helpful for us:

  1. the full output when running with --debug
  2. more details about your stack — ideally your full dependencies and dev dependencies from package.json, otherwise minimally your framework and exact version
  3. are you able to successfully run a Preview Server on your site?

Please make sure all the above is done with the latest version (currently 23.11.1). Thank you!

@bleeckerj I'd also be curious to hear if anything changes when you comment out the email plugin from your netlify.toml.

serhalp avatar Nov 24 '25 22:11 serhalp

Hi All,

I did in fact try commenting out the email plugin from netlify.toml, along with the other edge functions. Running netlify dev from the repo did eventually result in this inexplicable crash. I'm not sure I'd call it specifically a crash, because the process just completely spins out such that it is not possible to ctrl-c out of it — I have to kill -9 the PID from another process / terminal.

Julian

Julian Bleecker, BSEE, MSEng, Ph.D. https://nearfuturelaboratory.com https://shop.nearfuturelaboratory.com https://julianbleecker.com https://omata.com

On Mon, Nov 24, 2025 at 2:24 PM Philippe Serhal @.***> wrote:

serhalp left a comment (netlify/cli#7539) https://github.com/netlify/cli/issues/7539#issuecomment-3572974091

Hi folks. Sorry for the silence here. Unfortunately there isn't much to go on here at the moment as we haven't been able to reproduce this on our end.

Some further details from any of you may prove helpful for us:

  1. the full output when running with --debug
  2. more details about your stack — ideally your full dependencies and dev dependencies from package.json, otherwise minimally your framework and exact version
  3. are you able to successfully run a Preview Server https://docs.netlify.com/manage/preview-servers/overview/ on your site?

Please make sure all the above is done with the latest version (currently 23.11.1). Thank you!

@bleeckerj https://github.com/bleeckerj I'd also be curious to hear if anything changes when you comment out the email plugin from your netlify.toml.

— Reply to this email directly, view it on GitHub https://github.com/netlify/cli/issues/7539#issuecomment-3572974091, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAL4FYX5G5EQZUV72275UD36OATVAVCNFSM6AAAAACDJGROSGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTKNZSHE3TIMBZGE . You are receiving this because you were mentioned.Message ID: @.***>

bleeckerj avatar Nov 26 '25 00:11 bleeckerj