Error on volar server startup - the argument 'id' must be a non-empty string
ohmree opened this issue · 9 comments
I'm using doom emacs and volar version 0.30.2
from the AUR package volar-server-bin
, but I've seen this error when using a version installed by lsp-mode
as well.
All 3 volar-*
processes have this in their logs when I enable lsp-mode
logging and browse to a vue file:
[Trace - 08:22:56 ] Sending request 'initialize - (1)'.
Params: {
"processId": null,
"rootPath": "/home/ohmree/code/js/my-vue-project",
"clientInfo": {
"name": "emacs",
"version": "GNU Emacs 28.0.90 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.30, cairo version 1.17.4)\n of 2021-12-14"
},
"rootUri": "file:///home/ohmree/code/js/my-vue-project",
"capabilities": {
"workspace": {
"workspaceEdit": {
"documentChanges": true,
"resourceOperations": [
"create",
"rename",
"delete"
]
},
"applyEdit": true,
"symbol": {
"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
]
}
},
"executeCommand": {
"dynamicRegistration": false
},
"didChangeWatchedFiles": {
"dynamicRegistration": true
},
"workspaceFolders": true,
"configuration": true,
"semanticTokens": {
"refreshSupport": false
},
"codeLens": {
"refreshSupport": true
},
"fileOperations": {
"didCreate": false,
"willCreate": false,
"didRename": false,
"willRename": false,
"didDelete": false,
"willDelete": false
}
},
"textDocument": {
"declaration": {
"linkSupport": true
},
"definition": {
"linkSupport": true
},
"implementation": {
"linkSupport": true
},
"typeDefinition": {
"linkSupport": true
},
"synchronization": {
"willSave": true,
"didSave": true,
"willSaveWaitUntil": true
},
"documentSymbol": {
"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
]
},
"hierarchicalDocumentSymbolSupport": true
},
"formatting": {
"dynamicRegistration": true
},
"rangeFormatting": {
"dynamicRegistration": true
},
"semanticTokens": {
"dynamicRegistration": true,
"requests": {
"range": true,
"full": true
},
"tokenModifiers": [
"declaration",
"definition",
"readonly",
"static",
"deprecated",
"abstract",
"async",
"modification",
"documentation",
"defaultLibrary"
],
"tokenTypes": [
"comment",
"keyword",
"string",
"number",
"regexp",
"operator",
"namespace",
"type",
"struct",
"class",
"interface",
"enum",
"typeParameter",
"function",
"method",
"member",
"property",
"event",
"macro",
"variable",
"parameter",
"label",
"enumConstant",
"enumMember",
"dependent",
"concept"
],
"formats": [
"relative"
]
},
"rename": {
"dynamicRegistration": true,
"prepareSupport": true
},
"codeAction": {
"dynamicRegistration": true,
"isPreferredSupport": true,
"codeActionLiteralSupport": {
"codeActionKind": {
"valueSet": [
"",
"quickfix",
"refactor",
"refactor.extract",
"refactor.inline",
"refactor.rewrite",
"source",
"source.organizeImports"
]
}
},
"resolveSupport": {
"properties": [
"edit",
"command"
]
},
"dataSupport": true
},
"completion": {
"completionItem": {
"snippetSupport": true,
"documentationFormat": [
"markdown",
"plaintext"
],
"resolveAdditionalTextEditsSupport": true,
"insertReplaceSupport": true,
"deprecatedSupport": true,
"resolveSupport": {
"properties": [
"documentation",
"details",
"additionalTextEdits",
"command"
]
},
"insertTextModeSupport": {
"valueSet": [
1,
2
]
}
},
"contextSupport": true
},
"signatureHelp": {
"signatureInformation": {
"parameterInformation": {
"labelOffsetSupport": true
}
}
},
"documentLink": {
"dynamicRegistration": true,
"tooltipSupport": true
},
"hover": {
"contentFormat": [
"markdown",
"plaintext"
]
},
"foldingRange": {
"dynamicRegistration": true
},
"callHierarchy": {
"dynamicRegistration": false
},
"publishDiagnostics": {
"relatedInformation": true,
"tagSupport": {
"valueSet": [
1,
2
]
},
"versionSupport": true
},
"linkedEditingRange": {
"dynamicRegistration": true
}
},
"window": {
"workDoneProgress": true,
"showMessage": null,
"showDocument": {
"support": true
}
}
},
"initializationOptions": {
"svelte": {
"plugin": {
"html": {
"documentSymbols": {
"enable": true
},
"tagComplete": {
"enable": true
},
"completions": {
"emmet": true,
"enable": true
},
"hover": {
"enable": true
},
"enable": true
}
}
},
"typescript": {
"autoClosingTags": true,
"check": {
"npmIsInstalled": true
},
"disableAutomaticTypeAcquisition": false,
"format": {
"enable": true,
"insertSpaceAfterCommaDelimiter": true,
"insertSpaceAfterConstructor": false,
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"insertSpaceAfterKeywordsInControlFlowStatements": true,
"insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": true,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
"insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
"insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
"insertSpaceAfterSemicolonInForStatements": true,
"insertSpaceAfterTypeAssertion": false,
"insertSpaceBeforeAndAfterBinaryOperators": true,
"insertSpaceBeforeFunctionParenthesis": false,
"placeOpenBraceOnNewLineForControlBlocks": false,
"placeOpenBraceOnNewLineForFunctions": false
},
"implementationsCodeLens": {
"enabled": false
},
"preferences": {
"importModuleSpecifier": "auto",
"quoteStyle": "auto",
"renameShorthandProperties": true
},
"referencesCodeLens": {
"enabled": false
},
"reportStyleChecksAsWarnings": true,
"suggest": {
"autoImports": true,
"completeFunctionCalls": false,
"completeJSDocs": true,
"enabled": true,
"paths": true
},
"suggestionActions": {
"enabled": true
},
"surveys": {
"enabled": true
},
"tsc": {
"autoDetect": "on"
},
"tsserver": {
"log": "off",
"trace": "off"
},
"updateImportsOnFileMove": {
"enabled": "prompt"
},
"validate": {
"enable": true
},
"serverPath": ""
},
"html": {
"trace": {
"server": "off"
},
"autoClosingTags": true,
"validate": {
"styles": true,
"scripts": true
},
"suggest": {
"html5": true
},
"format": {
"wrapAttributes": "auto",
"extraLiners": "head, body, /html",
"endWithNewline": false,
"indentHandlebars": false,
"preserveNewLines": true,
"indentInnerHtml": false,
"contentUnformatted": "pre,code,textarea",
"unformatted": "wbr",
"wrapLineLength": 120,
"enable": true
},
"hover": true
},
"vetur": {
"languageFeatures": {
"codeActions": true
}
},
"languageFeatures": {
"references": true,
"definition": true,
"typeDefinition": true,
"callHierarchy": true,
"hover": true,
"rename": true,
"renameFileRefactoring": true,
"signatureHelp": true,
"codeAction": true,
"completion": {
"defaultTagNameCase": "both",
"defaultAttrNameCase": "kebabCase",
"getDocumentNameCasesRequest": false,
"getDocumentSelectionRequest": false
},
"schemaRequestService": true
}
},
"workDoneToken": "1"
}
[Trace - 08:22:56 ] Received response 'initialize - (1)' in 554ms.
Result: {
"code": -32603,
"message": "Request initialize failed with message: The argument 'id' must be a non-empty string. Received ''"
}
Can you try this project volar-start and verify that it is normal.
I have the same error on windows.I try volar-start, and the result is the same error. But it disappear on FreeBSD
@tomblackwhite Add (setq lsp-volar-take-over-mode nil)
to your config to see if it will be work.
It isn't work @jadestrong
I have make a push to fix the problem which is because the variable typescript.serverPath
didn't get properly on windows.
Please try again.
It works
Can you try this project volar-start and verify that it is normal.
Hi, sorry for taking a while to answer.
I've just tried it and it seems to work fine in the starter project.
Sadly my project isn't open source so I can't share the code.
Is there anything I can do to help debug this?
I think I can share my vite config and package.json
at the very least, and I can say that the project was started from vitesse-webext but I rewrote all the html templates in pug.
Huh, I just tried it again and apparently in the starter project it thought my home directory was the workspace root.
I removed it, added the volar-starter
directory to lsp-mode's workspace folders, closed the workspace (SPC TAB d
in doom), then opened a new one with my own project and selected a vue file.
It then asked me if I wanted to add the project directory to lsp's workspace folders and I hit i
for "yes", it started the 3 volar servers and now everything seems to be working fine.
@ohmree Ok. Maybe you can add (setq lsp-auto-guess-root t)
to your config file, then the lsp will auto guess the workspace root.At least it works well in a git project. If you found lsp cache a wrong workspace folder, you can remove it by M-x lsp-workspace-folders-remove
.