nvim --version: NVIM v0.5.0-397-g96059d72e$TERM: vtpconnpm install -g typescript-language-server, configure with :lua require('nvim_lsp').tsserver.setup{}package.json.It gives me this error:
Error detected while processing FileType Autocommands for "javascript":
E5108: Error executing lua ...evPrograms\Neovim\share\nvim\runtime\lua\vim\lsp\rpc.lua:259: attempt to index upvalue 'handle' (a nil value)
and doesn't work.
It just works
Does your project's package.json includes typescript?
typescript-language-server needs tsc command.
If not, you should add typescript to your package.json or execute npm install -g typescript.
I tried both installing typescript globally and locally, but it didn't work. I also installed the typescript-language-server and typescript to the folder the automatic installer would install to (from :LspInstallInfo) if it worked but still doesn't work. Same error.
Sorry about the closing, chrome's dark mode made the button text unreadable.
@K1DV5 Would you paste the result of executing :lua print(vim.inspect(vim.lsp.buf_get_clients())) after the error.
Weird, its {}
@h-michael any news yet?
@K1DV5 Can you use other language servers?
Does it occur with only typescript-language-server?
@h-michael Yes, texlab and pyls work just fine. Only tsserver is not working.
@h-michael I just found the problem. On Windows, the binary for typescript-language-server is not really a binary (.exe file) but a batch file (.cmd). That means it cannot be found with just the name typescript-language-server as a normal binary by nvim/libuv. Simply changing the command to typescript-language-server.cmd solved the problem. Now this change can be made permanent in the config by checking if the platform is win32 and appending .cmd to the command. (I could submit a pull request but I'm on mobile.)
I have also met a similar issue with pyls on Linux. In my case, it is the pyls executable is not properly installed and broken. I uninstalled the old pyls and reinstalled. Everything works now.
Most helpful comment
@h-michael I just found the problem. On Windows, the binary for
typescript-language-serveris not really a binary (.exe file) but a batch file (.cmd). That means it cannot be found with just the nametypescript-language-serveras a normal binary by nvim/libuv. Simply changing the command totypescript-language-server.cmdsolved the problem. Now this change can be made permanent in the config by checking if the platform is win32 and appending.cmdto the command. (I could submit a pull request but I'm on mobile.)