neovim/nvim-lspconfig

ts_ls throws errors (node js "Maximum call stack size exceeded")

ceejey opened this issue · 2 comments

Description

Description

I have added ts_ls to my mason ensure installed list and added the lsp config for ts_ls. ts_ls gets installed successfully and if I open a .js file it seems that the lsp config is trying to load but throws following error:

Error executing vim.schedule lua callback: ...m Files\Neovim\share\nvim\runtime/lua/vim/lsp/client.lua:588: RPC[Error] code_name = InternalError, message = "Request initialize failed with message: Maximum call stack size exceeded" stack traceback: [C]: in function 'assert' ...m Files\Neovim\share\nvim\runtime/lua/vim/lsp/client.lua:588: in function 'fn' vim/_editor.lua:351: in function <vim/_editor.lua:350>

System Info

OS: Windows 11
Neovim version: v0.10.2
ts_ls was installed using mason

Lsp config:

lspconfig.ts_ls.setup {
on_attach = on_attach,
root_dir = function()
return vim.fn.getcwd()
end,
capabilities = capabilities
}

LspInfo:

lspconfig: require("lspconfig.health").check()

LSP configs active in this session (globally) ~

  • Configured servers: pylsp, powershell_es, yamlls, ts_ls, lua_ls
  • OK Deprecated servers: (none)

LSP configs active in this buffer (bufnr: 2) ~

  • Language client log: ~\AppData\Local\nvim-data\lsp.log
  • Detected filetype: javascript
  • 0 client(s) attached to this buffer
  • Other clients that match the "javascript" filetype:
  • Config: ts_ls
    filetypes: javascript, javascriptreact, javascript.jsx, typescript, typescriptreact, typescript.tsx
    cmd: ~\AppData\Local\nvim-data\mason\bin\typescript-language-server.CMD --stdio
    version: 4.3.3
    executable: true
    autostart: true
    root directory: ~\Git\configs

Language client log: ~\AppData\Local\nvim-data\lsp.log

Are there any more info in that log? (Do not post the entire log here; use your judgement to find useful messages in the log, and post only those).

"Request initialize failed with message: Maximum call stack size exceeded"

That call stack error comes from javascript. This could be a bug in ts_ls.

Okay, I fixed it.
Note to myself: Stick with LTS version of nodejs (typescript-language-server/typescript-language-server#926)
Thanks anyway :)