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

volar language service errors #20010

Closed
Lilja opened this issue Aug 30, 2022 · 8 comments
Closed

volar language service errors #20010

Lilja opened this issue Aug 30, 2022 · 8 comments
Labels
bug issues reporting wrong behavior lsp

Comments

@Lilja
Copy link

Lilja commented Aug 30, 2022

Neovim version (nvim -v)

NVIM v0.8.0-dev-984-g568737d5b

Language server name/version

volar 0.40.4

Operating system/version

mac os 12.2.1

Steps to reproduce using "nvim -u minimal_init.lua"

Open with nvim -u minimal_init.lua tab.vue.

tab.vue, click to view
<template>
    <section class="use-tabs">
        <div class="tabs">
            <a
                v-for="(tab, index) in tabs"
                :key="tab"
                :class="[
                    'hover:no-underline tab',
                    {
                        active: selectedIndex == index,
                    },
                ]"
                @click="() => onClick(index)"
            >
                {{ tab }}
            </a>
        </div>
    </section>
</template>

<script lang="ts" setup>
import { defineProps, PropType, ref } from "vue";

const props = defineProps({
    tabs: {
        type: Array as PropType<string[]>,
        required: true,
    },
    selectedIndex: {
        type: Number as PropType<number>,
        required: true,
    },
});
const emit = defineEmits(["selected"]);

const onClick = (index: number) => {
    emit("selected", index);
};
</script>

Expected behavior

No errors

Actual behavior

Error executing vim.schedule lua callback: .../Downloads/nvim-macos/share/nvim/runtime/lua/vim/lsp.lua:1284: RPC[Error] code_name = InternalError, message = "Request initialize failed with message:
The argument 'id' must be a non-empty string. Received ''"
stack traceback:
        [C]: in function 'assert'
        .../Downloads/nvim-macos/share/nvim/runtime/lua/vim/lsp.lua:1284: in function ''
        vim/_editor.lua: in function <vim/_editor.lua:0>
[START][2022-08-30 11:46:27] LSP logging initiated
[START][2022-08-30 11:46:34] LSP logging initiated
[START][2022-08-30 11:51:01] LSP logging initiated
[START][2022-08-30 11:53:10] LSP logging initiated
[INFO][2022-08-30 11:56:34] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 11:56:44] LSP logging initiated
[INFO][2022-08-30 11:57:38] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 13:04:38] LSP logging initiated
[INFO][2022-08-30 13:05:40] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 13:05:42] LSP logging initiated
[START][2022-08-30 13:05:54] LSP logging initiated
[START][2022-08-30 13:06:08] LSP logging initiated
[INFO][2022-08-30 13:06:08] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "-E", "/Users/lilja/opt/homebrew//main.lua" },  cmd = "/Users/lilja/opt/homebrew//bin/lua-language-server",  extra = {    cwd = "/Users/lilja/dotfiles"  }}
[INFO][2022-08-30 13:06:14] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 13:06:14] LSP logging initiated
[INFO][2022-08-30 13:06:14] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "-E", "/Users/lilja/opt/homebrew/main.lua" },  cmd = "/Users/lilja/opt/homebrew/bin/lua-language-server",  extra = {    cwd = "/Users/lilja/dotfiles"  }}
[INFO][2022-08-30 13:08:19] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 13:08:21] LSP logging initiated
[INFO][2022-08-30 13:08:21] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "-E", "/opt/homebrew/main.lua" },  cmd = "/opt/homebrew/bin/lua-language-server",  extra = {    cwd = "/Users/lilja/dotfiles"  }}
[DEBUG][2022-08-30 13:08:21] .../vim/lsp/rpc.lua:347    "rpc.send"      {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      callHierarchy = {        dynamicRegistration = false      },      textDocument = {        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = false,          resolveSupport = {            properties = { "edit" }          }        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },preselectSupport = false,            snippetSupport = true          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          linkSupport = true        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = false        },        implementation = {          linkSupport = true        },        publishDiagnostics = {          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = false,          prepareSupport = true        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = false,          willSaveWaitUntil = false        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = false        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        symbol = {          dynamicRegistration = false,          hierarchicalWorkspaceSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.7.2"    },    initializationOptions = vim.empty_dict(),    processId = 34543,    rootPath = "/Users/lilja/dotfiles",    rootUri = "file:///Users/lilja/dotfiles",    trace = "off",    workspaceFolders = { {        name = "/Users/lilja/dotfiles",        uri = "file:///Users/lilja/dotfiles"      } }  }}
[ERROR][2022-08-30 13:08:22] .../vim/lsp/rpc.lua:420    "rpc"   "/opt/homebrew/bin/lua-language-server" "stderr"        "/opt/homebrew/Cellar/lua-language-server/3.5.3/libexec/bin/lua-language-server: ...ew/Cellar/lua-language-server/3.5.3/libexec/bin/main.lua:85: cannot open /opt/homebrew/main.lua: No such file or directory\nstack traceback:\n\t[C]: in function 'assert'\n\t...ew/Cellar/lua-language-server/3.5.3/libexec/bin/main.lua:85: in main chunk\n\t[C]: in ?\n"
[INFO][2022-08-30 14:21:36] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 14:22:48] LSP logging initiated
[INFO][2022-08-30 14:23:12] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 14:25:40] LSP logging initiated
[INFO][2022-08-30 14:25:49] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 14:28:08] LSP logging initiated
[INFO][2022-08-30 14:28:13] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "--stdio" },  cmd = "vue-language-server",  extra = {    cwd = "/Users/lilja/code/customs-cds-app/app"  }}
[DEBUG][2022-08-30 14:28:13] .../vim/lsp/rpc.lua:347    "rpc.send"      {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      callHierarchy = {        dynamicRegistration = false      },      textDocument = {        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = false,          resolveSupport = {            properties = { "edit" }          }        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },preselectSupport = false,            snippetSupport = true          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          linkSupport = true        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = false        },        implementation = {          linkSupport = true        },        publishDiagnostics = {          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = false,          prepareSupport = true        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = false,          willSaveWaitUntil = false        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = false        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        symbol = {          dynamicRegistration = false,          hierarchicalWorkspaceSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.7.2"    },    initializationOptions = {      documentFeatures = {        documentColor = false,        documentFormatting = {          defaultPrintWidth = 100        },        documentSymbol = true,        foldingRange = true,        linkedEditingRange = true,        selectionRange = true      },      languageFeatures = {        callHierarchy = true,        codeAction = true,        codeLens = true,        completion = {          defaultAttrNameCase = "kebabCase",          defaultTagNameCase = "both"        },        definition = true,        diagnostics = true,        documentHighlight = true,        documentLink = true,        hover = true,        implementation = true,        references = true,        rename = true,        renameFileRefactoring = true,        schemaRequestService = true,        semanticTokens = false,        signatureHelp = true,        typeDefinition = true      },      typescript = {        serverPath = ""      }    },    processId = 37789,    rootPath = "/Users/lilja/code/customs-cds-app/app",    rootUri = "file:///Users/lilja/code/customs-cds-app/app",    trace = "off",    workspaceFolders = { {        name = "/Users/lilja/code/customs-cds-app/app",        uri = "file:///Users/lilja/code/customs-cds-app/app"      } }  }}
[INFO][2022-08-30 14:28:13] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "--stdio" },  cmd = "vscode-eslint-language-server",  extra = {    cwd = "/Users/lilja/code/customs-cds-app/app"  }}
[DEBUG][2022-08-30 14:28:13] .../vim/lsp/rpc.lua:454    "rpc.receive"   {  error = {    code = -32603,    message = "Request initialize failed with message: The argument 'id' must be a non-empty string. Received ''"  },  id = 1,  jsonrpc = "2.0"}
[INFO][2022-08-30 14:28:36] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "-E", "/opt/homebrew/main.lua" },  cmd = "/opt/homebrew/bin/lua-language-server",  extra = {    cwd = "/Users/lilja/dotfiles"  }}
[DEBUG][2022-08-30 14:28:36] .../vim/lsp/rpc.lua:347    "rpc.send"      {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      callHierarchy = {        dynamicRegistration = false      },      textDocument = {        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = false,          resolveSupport = {            properties = { "edit" }          }        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },preselectSupport = false,            snippetSupport = true          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          linkSupport = true        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = false        },        implementation = {          linkSupport = true        },        publishDiagnostics = {          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = false,          prepareSupport = true        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = false,          willSaveWaitUntil = false        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = false        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        symbol = {          dynamicRegistration = false,          hierarchicalWorkspaceSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.7.2"    },    initializationOptions = vim.empty_dict(),    processId = 37789,    rootPath = "/Users/lilja/dotfiles",    rootUri = "file:///Users/lilja/dotfiles",    trace = "off",    workspaceFolders = { {        name = "/Users/lilja/dotfiles",        uri = "file:///Users/lilja/dotfiles"      } }  }}
[ERROR][2022-08-30 14:28:36] .../vim/lsp/rpc.lua:420    "rpc"   "/opt/homebrew/bin/lua-language-server" "stderr"        "/opt/homebrew/Cellar/lua-language-server/3.5.3/libexec/bin/lua-language-server: ...ew/Cellar/lua-language-server/3.5.3/libexec/bin/main.lua:85: cannot open /opt/homebrew/main.lua: No such file or directory\nstack traceback:\n\t[C]: in function 'assert'\n\t...ew/Cellar/lua-language-server/3.5.3/libexec/bin/main.lua:85: in main chunk\n\t[C]: in ?\n"
[INFO][2022-08-30 14:28:43] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 14:28:44] LSP logging initiated
[INFO][2022-08-30 14:28:45] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "--stdio" },  cmd = "vue-language-server",  extra = {    cwd = "/Users/lilja/code/customs-cds-app/app"  }}
[DEBUG][2022-08-30 14:28:45] .../vim/lsp/rpc.lua:347    "rpc.send"      {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      callHierarchy = {        dynamicRegistration = false      },      textDocument = {        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = false,          resolveSupport = {            properties = { "edit" }          }        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },preselectSupport = false,            snippetSupport = true          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          linkSupport = true        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = false        },        implementation = {          linkSupport = true        },        publishDiagnostics = {          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = false,          prepareSupport = true        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = false,          willSaveWaitUntil = false        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = false        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        symbol = {          dynamicRegistration = false,          hierarchicalWorkspaceSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.7.2"    },    initializationOptions = {      documentFeatures = {        documentColor = false,        documentFormatting = {          defaultPrintWidth = 100        },        documentSymbol = true,        foldingRange = true,        linkedEditingRange = true,        selectionRange = true      },      languageFeatures = {        callHierarchy = true,        codeAction = true,        codeLens = true,        completion = {          defaultAttrNameCase = "kebabCase",          defaultTagNameCase = "both"        },        definition = true,        diagnostics = true,        documentHighlight = true,        documentLink = true,        hover = true,        implementation = true,        references = true,        rename = true,        renameFileRefactoring = true,        schemaRequestService = true,        semanticTokens = false,        signatureHelp = true,        typeDefinition = true      },      typescript = {        serverPath = ""      }    },    processId = 38101,    rootPath = "/Users/lilja/code/customs-cds-app/app",    rootUri = "file:///Users/lilja/code/customs-cds-app/app",    trace = "off",    workspaceFolders = { {        name = "/Users/lilja/code/customs-cds-app/app",        uri = "file:///Users/lilja/code/customs-cds-app/app"      } }  }}
[DEBUG][2022-08-30 14:28:45] .../vim/lsp/rpc.lua:454    "rpc.receive"   {  error = {    code = -32603,    message = "Request initialize failed with message: The argument 'id' must be a non-empty string. Received ''"  },  id = 1,  jsonrpc = "2.0"}
[INFO][2022-08-30 14:33:30] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 14:33:51] LSP logging initiated
[INFO][2022-08-30 14:33:51] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "--stdio" },  cmd = "vue-language-server",  extra = {    cwd = "/Users/lilja/code/customs-cds-app/app"  }}
[DEBUG][2022-08-30 14:33:51] .../vim/lsp/rpc.lua:347    "rpc.send"      {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      callHierarchy = {        dynamicRegistration = false      },      textDocument = {        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = false,          resolveSupport = {            properties = { "edit" }          }        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },preselectSupport = false,            snippetSupport = true          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          linkSupport = true        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = false        },        implementation = {          linkSupport = true        },        publishDiagnostics = {          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = false,          prepareSupport = true        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = false,          willSaveWaitUntil = false        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = false        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        symbol = {          dynamicRegistration = false,          hierarchicalWorkspaceSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.7.2"    },    initializationOptions = {      documentFeatures = {        documentColor = false,        documentFormatting = {          defaultPrintWidth = 100        },        documentSymbol = true,        foldingRange = true,        linkedEditingRange = true,        selectionRange = true      },      languageFeatures = {        callHierarchy = true,        codeAction = true,        codeLens = true,        completion = {          defaultAttrNameCase = "kebabCase",          defaultTagNameCase = "both"        },        definition = true,        diagnostics = true,        documentHighlight = true,        documentLink = true,        hover = true,        implementation = true,        references = true,        rename = true,        renameFileRefactoring = true,        schemaRequestService = true,        semanticTokens = false,        signatureHelp = true,        typeDefinition = true      },      typescript = {        serverPath = ""      }    },    processId = 38393,    rootPath = "/Users/lilja/code/customs-cds-app/app",    rootUri = "file:///Users/lilja/code/customs-cds-app/app",    trace = "off",    workspaceFolders = { {        name = "/Users/lilja/code/customs-cds-app/app",        uri = "file:///Users/lilja/code/customs-cds-app/app"      } }  }}
[DEBUG][2022-08-30 14:33:51] .../vim/lsp/rpc.lua:454    "rpc.receive"   {  error = {    code = -32603,    message = "Request initialize failed with message: The argument 'id' must be a non-empty string. Received ''"  },  id = 1,  jsonrpc = "2.0"}
[INFO][2022-08-30 14:34:22] .../lua/vim/lsp.lua:1392    "exit_handler"  {}
[START][2022-08-30 14:39:32] LSP logging initiated
[INFO][2022-08-30 14:39:32] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "-E", "/opt/homebrew/main.lua" },  cmd = "/opt/homebrew/bin/lua-language-server",  extra = {    cwd = "/Users/lilja/code/customs-cds-app"  }}
[DEBUG][2022-08-30 14:39:32] .../vim/lsp/rpc.lua:347    "rpc.send"      {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      callHierarchy = {        dynamicRegistration = false      },      textDocument = {        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = false,          resolveSupport = {            properties = { "edit" }          }        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },preselectSupport = false,            snippetSupport = true          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          linkSupport = true        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = false        },        implementation = {          linkSupport = true        },        publishDiagnostics = {          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = false,          prepareSupport = true        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = false,          willSaveWaitUntil = false        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = false        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        symbol = {          dynamicRegistration = false,          hierarchicalWorkspaceSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.7.2"    },    initializationOptions = vim.empty_dict(),    processId = 44840,    rootPath = "/Users/lilja/code/customs-cds-app",    rootUri = "file:///Users/lilja/code/customs-cds-app",    trace = "off",    workspaceFolders = { {        name = "/Users/lilja/code/customs-cds-app",        uri = "file:///Users/lilja/code/customs-cds-app"      } }  }}
[ERROR][2022-08-30 14:39:32] .../vim/lsp/rpc.lua:420    "rpc"   "/opt/homebrew/bin/lua-language-server" "stderr"        "/opt/homebrew/Cellar/lua-language-server/3.5.3/libexec/bin/lua-language-server: ...ew/Cellar/lua-language-server/3.5.3/libexec/bin/main.lua:85: cannot open /opt/homebrew/main.lua: No such file or directory\nstack traceback:\n\t[C]: in function 'assert'\n\t...ew/Cellar/lua-language-server/3.5.3/libexec/bin/main.lua:85: in main chunk\n\t[C]: in ?\n"
[INFO][2022-08-30 14:40:49] .../vim/lsp/rpc.lua:261     "Starting RPC client"   {  args = { "-E", "/opt/homebrew/main.lua" },  cmd = "/opt/homebrew/bin/lua-language-server",  extra = {    cwd = "/Users/lilja/dotfiles"  }}
[DEBUG][2022-08-30 14:40:49] .../vim/lsp/rpc.lua:347    "rpc.send"      {  id = 1,  jsonrpc = "2.0",  method = "initialize",  params = {    capabilities = {      callHierarchy = {        dynamicRegistration = false      },      textDocument = {        codeAction = {          codeActionLiteralSupport = {            codeActionKind = {              valueSet = { "", "Empty", "QuickFix", "Refactor", "RefactorExtract", "RefactorInline", "RefactorRewrite", "Source", "SourceOrganizeImports", "quickfix", "refactor", "refactor.extract", "refactor.inline", "refactor.rewrite", "source", "source.organizeImports" }            }          },          dataSupport = true,          dynamicRegistration = false,          resolveSupport = {            properties = { "edit" }          }        },        completion = {          completionItem = {            commitCharactersSupport = false,            deprecatedSupport = false,            documentationFormat = { "markdown", "plaintext" },preselectSupport = false,            snippetSupport = true          },          completionItemKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25 }          },          contextSupport = false,          dynamicRegistration = false        },        declaration = {          linkSupport = true        },        definition = {          linkSupport = true        },        documentHighlight = {          dynamicRegistration = false        },        documentSymbol = {          dynamicRegistration = false,          hierarchicalDocumentSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        hover = {          contentFormat = { "markdown", "plaintext" },          dynamicRegistration = false        },        implementation = {          linkSupport = true        },        publishDiagnostics = {          relatedInformation = true,          tagSupport = {            valueSet = { 1, 2 }          }        },        references = {          dynamicRegistration = false        },        rename = {          dynamicRegistration = false,          prepareSupport = true        },        signatureHelp = {          dynamicRegistration = false,          signatureInformation = {            activeParameterSupport = true,            documentationFormat = { "markdown", "plaintext" },            parameterInformation = {              labelOffsetSupport = true            }          }        },        synchronization = {          didSave = true,          dynamicRegistration = false,          willSave = false,          willSaveWaitUntil = false        },        typeDefinition = {          linkSupport = true        }      },      window = {        showDocument = {          support = false        },        showMessage = {          messageActionItem = {            additionalPropertiesSupport = false          }        },        workDoneProgress = true      },      workspace = {        applyEdit = true,        configuration = true,        symbol = {          dynamicRegistration = false,          hierarchicalWorkspaceSymbolSupport = true,          symbolKind = {            valueSet = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26 }          }        },        workspaceEdit = {          resourceOperations = { "rename", "create", "delete" }        },        workspaceFolders = true      }    },    clientInfo = {      name = "Neovim",      version = "0.7.2"    },    initializationOptions = vim.empty_dict(),    processId = 44840,    rootPath = "/Users/lilja/dotfiles",    rootUri = "file:///Users/lilja/dotfiles",    trace = "off",    workspaceFolders = { {        name = "/Users/lilja/dotfiles",        uri = "file:///Users/lilja/dotfiles"      } }  }}
[ERROR][2022-08-30 14:40:49] .../vim/lsp/rpc.lua:420    "rpc"   "/opt/homebrew/bin/lua-language-server" "stderr"        "/opt/homebrew/Cellar/lua-language-server/3.5.3/libexec/bin/lua-language-server: ...ew/Cellar/lua-language-server/3.5.3/libexec/bin/main.lua:85: cannot open /opt/homebrew/main.lua: No such file or directory\nstack traceback:\n\t[C]: in function 'assert'\n\t...ew/Cellar/lua-language-server/3.5.3/libexec/bin/main.lua:85: in main chunk\n\t[C]: in ?\n"

Log file

https://gist.github.com/Lilja/d7bc8c812cf20c5020c7ae4b20d71334

@Lilja Lilja added bug issues reporting wrong behavior lsp labels Aug 30, 2022
@ccoolsnake

This comment was marked as duplicate.

@johnsoncodehk
Copy link

typescript.serverPath -> typescript.tsdk is required for language server in initializationOptions. (See vuejs/language-tools#1916)

@shubham-cpp
Copy link

Following this didn't resolve the issue

Volar config
local util = require 'lspconfig.util'
local path = util.path
local volar_path = path.join(vim.fn.stdpath 'data', 'lsp_servers', 'volar', 'node_modules')
local global_ts_server_path = path.join(volar_path, 'typescript', 'lib')

local function get_typescript_lib_path(root_dir)
  local project_root = util.find_node_modules_ancestor(root_dir)
  return project_root and (path.join(project_root, 'node_modules', 'typescript', 'lib')) 
            or global_ts_server_path
end

lspconfig.volar.setup({
  init_options = {
    typescript = {
      tsdk = '',
    },
  },
  on_new_config = function(new_config, new_root_dir)
    new_config.init_options.typescript.tsdk = get_typescript_lib_path(new_root_dir)
  end,
  capabilities = cmp_capabilities,
  on_attach = on_attach,
  flags = { debounce_text_changes = 150 },
  settings = {
    volar = { autoCompleteRefs = true },
  },
})

Still getting error

Error executing vim.schedule lua callback: /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1285: 
RPC[Error] code_name = InternalError, message = "Request initialize failed with message: 
Cannot read properties of undefined (reading 'createLanguageService')"
stack traceback:
	[C]: in function 'assert'
	/usr/local/share/nvim/runtime/lua/vim/lsp.lua:1285: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

@Lilja
Copy link
Author

Lilja commented Oct 9, 2022

Update to latest lsp-config and updated volar. Now seems to be working.

@Lilja Lilja closed this as completed Oct 9, 2022
@dithmer
Copy link

dithmer commented Oct 9, 2022

Following this didn't resolve the issue
Volar config

Still getting error

Error executing vim.schedule lua callback: /usr/local/share/nvim/runtime/lua/vim/lsp.lua:1285: 
RPC[Error] code_name = InternalError, message = "Request initialize failed with message: 
Cannot read properties of undefined (reading 'createLanguageService')"
stack traceback:
	[C]: in function 'assert'
	/usr/local/share/nvim/runtime/lua/vim/lsp.lua:1285: in function ''
	vim/_editor.lua: in function <vim/_editor.lua:0>

Still have the same error, after updating to newest nvim-lspconfig, witth @volar/vue-language-server@1.0.3

Anything I am missing, or do other people also experience this issue?

EDIT:
Drawback, had to understand, that I cannot simply let the new tsdk path empty, but must set it with the path to my typescript installation (in my case globally installed). Works now.

@bab014
Copy link

bab014 commented Dec 2, 2022

I had the same issue and @dithmer post fixed it. Point to the global install of Typescript, in my case the option looked like this

init_options = {
    typescript = {
        tsdk = "/usr/local/lib/node_modules/typescript/lib"
    }
}

@alexventuraio
Copy link

I'm using mason along side mason-lspconfig and I installed tsserver and volar with it.
Also, not sure if that helps, but I installed Volar as stated here in the docs using yarn global add @vue/language-server.

But I was getting this error:

Error executing vim.schedule lua callback: ...w/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/lsp.lua:1308: RPC[Error] code_name = InternalError, message = "Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in /Users/alex/Workspace/trello_team/node_modules/typescript/lib"
stack traceback:
        [C]: in function 'assert'
        ...w/Cellar/neovim/0.9.5/share/nvim/runtime/lua/vim/1sp.lua:1308: in function ''
        vim/_editor.lua: in function <vim/_editor.lua: 0>
Press ENTER or type command to continue
Screenshot 2024-02-28 at 0 22 05

Then, I just used the typescript already installed by mason as the tsdk config:

lspconfig['volar'].setup({
  init_options = {
    typescript = {
      tsdk = '/Users/alex/.local/share/nvim/mason/packages/typescript-language-server/node_modules/typescript/lib'
    }
  }
})

And it worked fine!

@2nOrderEDO
Copy link

Had a similar problem with the following error:

Error executing vim.schedule lua callback: ....mount_nvimaM7Klx/usr/share/nvim/runtime/lua/vim/lsp.lua:1308: RPC[Error] code_name = InternalError, message = "Request init
ialize failed with message: Can't find typescript.js or tsserverlibrary.js in \"/home/enrique/Desktop/vue-cli-01-a-new-vue-project/node_modules/typescript/l
ib\""                                                                                                                                                                     
stack traceback:                                                                                                                                                          
        [C]: in function 'assert'                                                                                                                                         
        ....mount_nvimaM7Klx/usr/share/nvim/runtime/lua/vim/lsp.lua:1308: in function ''                                                                                  
        vim/_editor.lua: in function <vim/_editor.lua:0>  

In my case I was using nvm to install nodejs and typescript, so I had to add the path to my default node version:

lspconfig.volar.setup({
  capabilities = capabilities,                                                                                                         
  init_options = {                                                                                                     
    typescript = {                                                                                                     
      tsdk = '/home/enrique/.nvm/versions/node/v18.17.0/lib/node_modules/typescript/lib'                                                                                                
    }                                                                                                                  
  }
}) 

In my case serverPath="blablabla" did not work, but tsdk made the trick.

@neovim neovim locked and limited conversation to collaborators Mar 14, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug issues reporting wrong behavior lsp
Projects
None yet
Development

No branches or pull requests

8 participants