Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client typescript-tools quit with exit code 0 and signal 6. #304

Open
MannyFay opened this issue Oct 21, 2024 · 2 comments
Open

Client typescript-tools quit with exit code 0 and signal 6. #304

MannyFay opened this issue Oct 21, 2024 · 2 comments

Comments

@MannyFay
Copy link

Hi :)

if I open a Next.js/TypeScript project file in nvim, typescript-tools start to work flawlessly. But after about around ten seconds linting is gone away with this warning message:

Client typescript-tools quit with exit code 0 and signal 6. Check log ...

This is the output of the log file:

[START][2024-10-21 22:31:40] LSP logging initiated
[WARN][2024-10-21 22:31:40] ...lsp/handlers.lua:135	"The language server tailwindcss triggers a registerCapability handler for workspace/didChangeWorkspaceFolders despite dynamicRegistration set to false. Report upstream, this warning is harmless"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"\n<--- Last few GCs --->\n\n[68491:0x138008000]    29329 ms: Scavenge (interleaved) 4031.3 (4108.1) -> 4030.4 (4128.6) MB, pooled: 0 MB, 42.79 / 0.00 ms  (average mu = 0.669, current mu = 0.578) allocation failure; \n[68491:0x138008000]    32107 ms: Mark-Compact 4046.7 (4131.6) -> 4042.2 (4145.6) MB, pooled: 0 MB, 2652.38 / 0.00 ms  (average mu = 0.449, current mu = 0.144) allocation failure; scavenge might not succeed\n\n\n<--- JS stacktrace --->\n\nFATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory\n----- Native stack trace -----\n\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 1: 0x104bf4be8 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 2: 0x104d9dcbc v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n 3: 0x104d9dc70 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 4: 0x104f45964 v8::internal::Heap::CallGCPrologueCallbacks(v8::GCType, v8::GCCallbackFlags, v8::internal::GCTracer::Scope::ScopeId) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n 5: 0x104f447e0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 6: 0x104f3aca8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 7: 0x104f3b414 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 8: 0x104f11fc8 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 9: 0x104f12298 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"10: 0x105177424 v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Allocate(v8::internal::Isolate*, int, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n11: 0x10517707c v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash(v8::internal::Isolate*, v8::internal::Handle<v8::internal::OrderedHashMap>, int) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"12: 0x1052339e8 v8::internal::Runtime_MapGrow(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"13: 0x1049e1af4 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"14: 0x1049ac0c0 Builtins_MapPrototypeSet [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n15: 0x10dcac734 \n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"16: 0x10e4968bc \n17: 0x10dfe91e4 \n18: 0x10e32ad30 \n19: 0x10e55e6bc \n20: 0x10e54beac \n21: 0x10e25ccdc \n22: 0x10dca7a30 \n23: 0x10dc9a6ec \n24: 0x10e55f05c \n25: 0x10e54a72c \n26: 0x10dca7a30 \n27: 0x10dc9a6ec \n28: 0x10e55f05c \n29: 0x10dce4144 \n30: 0x10dc9109c \n31: 0x10dca7ac8 \n32: 0x10dc9af04 \n33: 0x10e55f05c \n34: 0x10dfe7c18 \n35: 0x10dca7a30 \n36: 0x10dc9a6ec \n37: 0x10e55f05c \n38: 0x10dce4144 \n39: 0x10dc9109c \n40: 0x10dca7b08 \n41: 0x10dc9af04 \n42: 0x10e55f05c \n43: 0x10e64a8c8 \n44: 0x10e550cd0 \n45: 0x10e402ed8 \n46: 0x10de1fcfc \n47: 0x10e310d3c \n48: 0x10e60db00 \n49: 0x10e312260 \n50: 0x10e3138c0 \n51: 0x10e659000 \n52: 0x10e60dc20 \n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"53: 0x10494cef0 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n54: 0x10494cef0 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n55: 0x10e33af5c \n56: 0x10e62db50 \n57: 0x10494ac0c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n58: 0x10494a8f4 Builtins_JSEntry [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"59: 0x104eb0c14 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n60: 0x104eb05b4 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>*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"61: 0x104db02d8 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n62: 0x104b8aeac node::Environment::RunTimers(uv_timer_s*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n63: 0x10913ad50 uv__run_timers [/opt/homebrew/Cellar/libuv/1.49.1/lib/libuv.1.dylib]\n64: 0x10913e1cc uv_run [/opt/homebrew/Cellar/libuv/1.49.1/lib/libuv.1.dylib]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"65: 0x104b0242c node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"66: 0x104c427bc node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"67: 0x104c42510 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"68: 0x104bafdc0 node::Start(int, char**) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n69: 0x18725b154 start [/usr/lib/dyld]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"\n<--- Last few GCs --->\n\n[68503:0x130008000]    30284 ms: Scavenge (interleaved) 4041.9 (4127.8) -> 4037.9 (4129.8) MB, pooled: 0 MB, 148.29 / 0.00 ms  (average mu = 0.629, current mu = 0.506) allocation failure; \n[68503:0x130008000]    32323 ms: Mark-Compact 4045.3 (4131.3) -> 4042.7 (4146.6) MB, pooled: 0 MB, 1973.17 / 0.00 ms  (average mu = 0.505, current mu = 0.318) allocation failure; scavenge might not succeed\n\n\n<--- JS stacktrace --->\n\nFATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"----- Native stack trace -----\n\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 1: 0x100c38be8 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 2: 0x100de1cbc v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 3: 0x100de1c70 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 4: 0x100f89964 v8::internal::Heap::CallGCPrologueCallbacks(v8::GCType, v8::GCCallbackFlags, v8::internal::GCTracer::Scope::ScopeId) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 5: 0x100f887e0 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 6: 0x100f7eca8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 7: 0x100f7f414 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 8: 0x100f55fc8 v8::internal::FactoryBase<v8::internal::Factory>::AllocateRawArray(int, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	" 9: 0x100f56298 v8::internal::FactoryBase<v8::internal::Factory>::NewFixedArrayWithFiller(v8::internal::Handle<v8::internal::Map>, int, v8::internal::Handle<v8::internal::HeapObject>, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"10: 0x1011bb424 v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Allocate(v8::internal::Isolate*, int, v8::internal::AllocationType) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"11: 0x1011bb07c v8::internal::OrderedHashTable<v8::internal::OrderedHashMap, 2>::Rehash(v8::internal::Isolate*, v8::internal::Handle<v8::internal::OrderedHashMap>, int) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"12: 0x1012779e8 v8::internal::Runtime_MapGrow(int, unsigned long*, v8::internal::Isolate*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"13: 0x100a25af4 Builtins_CEntry_Return1_ArgvOnStack_NoBuiltinExit [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"14: 0x1009f00c0 Builtins_MapPrototypeSet [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n15: 0x10a20e194 \n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"16: 0x10a61965c \n17: 0x10a6303a4 \n18: 0x10a479dd0 \n19: 0x10a26135c \n20: 0x10a27648c \n21: 0x10a272c7c \n22: 0x10a20a2b0 \n23: 0x10a64828c \n24: 0x10a261cfc \n25: 0x10a274d0c \n26: 0x10a20a2b0 \n27: 0x10a64828c \n28: 0x10a261cfc \n29: 0x10a732aa4 \n30: 0x10a62ae1c \n31: 0x10a20a348 \n32: 0x10a648aa4 \n33: 0x10a261cfc \n34: 0x10a633f58 \n35: 0x10a20a2b0 \n36: 0x10a64828c \n37: 0x10a261cfc \n38: 0x10a732aa4 \n39: 0x10a62ae1c \n40: 0x10a20a388 \n41: 0x10a648aa4 \n42: 0x10a261cfc \n43: 0x10a68e800 \n44: 0x10a256990 \n45: 0x10a542ed8 \n46: 0x10a18e3fc \n47: 0x10a4641fc \n48: 0x10a198880 \n49: 0x10a464be0 \n50: 0x10a466240 \n51: 0x10a5f7f80 \n52: 0x10a198ae0 \n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"53: 0x100990ef0 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"54: 0x100990ef0 Builtins_InterpreterEntryTrampoline [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n55: 0x10a6ec09c \n56: 0x10a6f90b0 \n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"57: 0x10098ec0c Builtins_JSEntryTrampoline [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n"
[ERROR][2024-10-21 22:32:11] ...ools/process.lua:184	"process"	"tsserver"	"stderr"	"58: 0x10098e8f4 Builtins_JSEntry [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n59: 0x100ef4c14 v8::internal::(anonymous namespace)::Invoke(v8::internal::Isolate*, v8::internal::(anonymous namespace)::InvokeParams const&) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n60: 0x100ef45b4 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>*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n61: 0x100df42d8 v8::Function::Call(v8::Local<v8::Context>, v8::Local<v8::Value>, int, v8::Local<v8::Value>*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n62: 0x100bceeac node::Environment::RunTimers(uv_timer_s*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n63: 0x10517ed50 uv__run_timers [/opt/homebrew/Cellar/libuv/1.49.1/lib/libuv.1.dylib]\n64: 0x1051821cc uv_run [/opt/homebrew/Cellar/libuv/1.49.1/lib/libuv.1.dylib]\n65: 0x100b4642c node::SpinEventLoopInternal(node::Environment*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n66: 0x100c867bc node::NodeMainInstance::Run(node::ExitCode*, node::Environment*) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n67: 0x100c86510 node::NodeMainInstance::Run() [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n68: 0x100bf3dc0 node::Start(int, char**) [/opt/homebrew/Cellar/node/22.9.0_1/bin/node]\n69: 0x18725b154 start [/usr/lib/dyld]\n"

I've read on betterstack - nodejs-errors that I should do export NODE_OPTIONS=--max_old_space_size=4096.
I've done this, but it doesn't has changed anything.

Can anybody help me, to go through this problem?

Regards,
Manny

@Avishayy
Copy link

Avishayy commented Nov 5, 2024

Hey, I faced this too and here's what I found out and how I fixed it:

This is the relevant option in this plugin's configuration

    -- this value is passed to: https://nodejs.org/api/cli.html#--max-old-space-sizesize-in-megabytes
    -- memory limit in megabytes or "auto"(basically no limit)
    tsserver_max_memory = "auto",

However, the documentation lies, using "auto" is not equivalent to no limit

if type(plugin_config.tsserver_max_memory) == "number" then
table.insert(self.args, 1, "--max-old-space-size=" .. plugin_config.tsserver_max_memory)
end

We set the value only if it is a number, otherwise this argument is unset.

From typescript-language-server's documentation:

The maximum size of the V8's old memory section in megabytes (for example 4096 means 4GB). The default value is dynamically configured by Node so can differ per system. Increase for very big projects that exceed allowed memory usage. Default: undefined

https://github.com/typescript-language-server/typescript-language-server/blob/master/docs/configuration.md

An example that will work and increase the memory to 8GB:

      require("typescript-tools").setup {
        on_attach = on_attach,
        settings = {
          tsserver_max_memory = 8192,
          tsserver_file_preferences = {
            includeCompletionsForModuleExports = true,
          },
        },
      }

please note that if you use a string for a value such as "8192" this will fail to increase the value.

@vlad1mirJ
Copy link

vlad1mirJ commented Nov 13, 2024

tsserver_max_memory = 8192,

This did fix it for me. Thanks!
Worth noting that it only happened for .js files, .ts works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants