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

The Vue Semantic Server server crashed 5 times in the last 3 minutes #1957

Closed
vit112 opened this issue Oct 8, 2022 · 5 comments
Closed

The Vue Semantic Server server crashed 5 times in the last 3 minutes #1957

vit112 opened this issue Oct 8, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@vit112
Copy link

vit112 commented Oct 8, 2022

Volar extention was working perfectly fine until this error appeared out of the blue today. I tried reinstalling vscode and volar. Then I increased --max-old-space-size for node and maxTsServerMemory. However, the error still remains.

VS code version 1.72.0
Volar version: v1.0.1
Ubuntu 22.04.1 LTS

[Info - 10:57:15 PM] Connection to server got closed. Server will restart.
[Error - 10:57:16 PM] Request textDocument/codeAction failed.
Message: Request textDocument/codeAction failed with message: Cannot read properties of undefined (reading '0')
Code: -32603
[Error - 10:57:16 PM] Request textDocument/documentLink failed.
Message: Request textDocument/documentLink failed with message: Cannot read properties of undefined (reading '0')
Code: -32603
[Error - 10:57:16 PM] Request textDocument/inlayHint failed.
Message: Request textDocument/inlayHint failed with message: Cannot read properties of undefined (reading '0')
Code: -32603
/usr/share/code/resources/app/extensions/node_modules/typescript/lib/typescript.js:41584
var rootExpression = (_a = sourceFile.statements[0]) === null || _a === void 0 ? void 0 : _a.expression;
^

TypeError: Cannot read properties of undefined (reading '0')
at convertConfigFileToObject (/usr/share/code/resources/app/extensions/node_modules/typescript/lib/typescript.js:41584:57)
at parseOwnConfigOfJsonSourceFile (/usr/share/code/resources/app/extensions/node_modules/typescript/lib/typescript.js:42411:20)
at parseConfig (/usr/share/code/resources/app/extensions/node_modules/typescript/lib/typescript.js:42307:13)
at parseJsonConfigFileContentWorker (/usr/share/code/resources/app/extensions/node_modules/typescript/lib/typescript.js:42123:28)
at Object.parseJsonSourceFileConfigFileContent (/usr/share/code/resources/app/extensions/node_modules/typescript/lib/typescript.js:42086:22)
at Object.mJ (/home/vt/.vscode/extensions/vue.volar-1.0.1-linux-x64/dist/node/server.js:841:3875)
at Object.resolveLanguageServiceHost (/home/vt/.vscode/extensions/vue.volar-1.0.1-linux-x64/dist/node/server.js:1119:12428)
at S (/home/vt/.vscode/extensions/vue.volar-1.0.1-linux-x64/dist/node/server.js:496:29747)
at /home/vt/.vscode/extensions/vue.volar-1.0.1-linux-x64/dist/node/server.js:496:27227
at Generator.next ()
[Error - 10:57:16 PM] The Vue Semantic Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Oct 9, 2022

It seems failed at https://github.com/johnsoncodehk/volar/blob/627a3ab84165cd851b471a8350d77f608612dc43/vue-language-tools/vue-language-core/src/utils/ts.ts#L32, I guess you have some tsconfig files it's empty or invalid jsonc format. I will check how to fault tolerance with it, you can check tsconfig content you have before fixs.

@vit112
Copy link
Author

vit112 commented Oct 9, 2022

Many thanks for the reply John.

You are right, there seems to be an invalid path under references in tsconfig. It does not crash after fixing that. Strangely enough, it did not cause any issues earlier.

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Oct 11, 2022

I guess this error is ignore by try catch in old version, I kind of want to keep this crash, otherwise when failed users just loses all intellisense without any hints. I will keep this issue open for more time to thinking.

@johnsoncodehk johnsoncodehk added the bug Something isn't working label Oct 11, 2022
@totalhack
Copy link

I got this error because I switched the name of a directory that was a workspace in vs code.

@prd-quy-nguyen
Copy link

I got this problem after setup pnpm. I am not sure if it is related to pnpm or not but I cannot fix it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants