Could not find 'ts_ls' or 'vtsls' lsp client, required by 'vue_ls'. #5603
-
Hi ! I've been trying for hours to make my configuration work but I always have the error
My config : local vue_ls_config = {}
vim.lsp.config('vue_ls', vue_ls_config)
local vue_language_server_path = '/usr/lib/node_modules/@vue/language-server'
local vue_plugin = {
name = '@vue/typescript-plugin',
location = vue_language_server_path,
languages = { 'vue' },
configNamespace = 'typescript',
enableForWorkspaceTypeScriptVersions = true,
}
vim.lsp.config('vtsls', {
filetypes = { 'typescript', 'javascript', 'javascriptreact', 'typescriptreact', 'vue' },
settings = {
vtsls = {
tsserver = {
globalPlugins = {
vue_plugin,
},
},
},
},
})
vim.lsp.enable({'vtsls', 'vue_ls'}) Can anyone help me? Thanks a lot 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 18 replies
-
Hi, I ran into the same issue and stumbled upon our question. I think the problem is that both language servers are starting in parallel and if To solve this vim.lsp.config('vtsls', {
filetypes = { ... },
settings = { ... },
+ on_attach = function()
+ vim.lsp.enable({'vue_ls'})
+ end
})
-vim.lsp.enable({'vtsls', 'vue_ls'})
+vim.lsp.enable({'vtsls'}) I don't love this solution but it seems to work. Maybe someone else has a better solution. And maybe there is even space for 'dependent language servers' in Neovim |
Beta Was this translation helpful? Give feedback.
-
For anyone joining. I tried :
|
Beta Was this translation helpful? Give feedback.
Solved. Obviously, I should have read the documentation more closely (which I did but you know… meh).
My vtsls never attached, that's why vue_ls never found it.
I just missed a .jsconfig or .tsconfig at the root of my project to vtsls attached too.
Sorry for wasting your time. Thanks @Jak-Ch-ll for helping out! 😊