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

Takeover mode cannot find TypeScript at path defined in settings.json anymore #2637

Closed
Anoesj opened this issue Apr 20, 2023 · 13 comments
Closed
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@Anoesj
Copy link

Anoesj commented Apr 20, 2023

Ever since I updated to vue-tsc 1.4.x, it seems like Volar cannot find my TypeScript lib anymore in Takeover mode. I defined this in .vscode/settings.json, because my folder structure is a little different (no node_modules in the root directory):

{
  "typescript.tsdk": "SomeDir/AnotherDir/node_modules/typescript/lib"
}

I get x.x.x (takover) in the bottom bar in VSCode and when clicked, it shows:
Code_10Wdmgr2DN

Interestingly, selecting VSCode's version of TS doesn't work anymore either, it shows notifications like "Vue Semantic Server client: couldn't create connection to server" outputs this to the Vue Semantic Server output tab:

[Info  - 11:40:58 PM] Connection to server got closed. Server will restart.
true
[Error - 11:40:58 PM] Server initialization failed.
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in undefined
  Code: -32603 
[Error - 11:40:58 PM] Vue Semantic Server client: couldn't create connection to server.
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in undefined
  Code: -32603 
[Error - 11:40:58 PM] Restarting server failed
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in undefined
  Code: -32603 
[Error - 11:41:00 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.

Any chance the vue-tsc update has anything to do with this?

@johnsoncodehk
Copy link
Member

Can you try relative path?

{
  "typescript.tsdk": "./SomeDir/AnotherDir/node_modules/typescript/lib"
}

@wenyongda
Copy link

I have the same problem.
{
"typescript.tsdk": "node_modules/typescript/lib"
}
image
image

[Error - 09:18:39] Restarting server failed
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in undefined
  Code: -32603 
[Error - 09:18:42] 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.
[Error - 09:18:54] Server initialization failed.
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in undefined
  Code: -32603 
[Error - 09:18:54] Vue Semantic Server client: couldn't create connection to server.
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in undefined
  Code: -32603 
[Error - 09:18:56] 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.

@Tanimodori
Copy link

Tanimodori commented Apr 21, 2023

1.4.0 breaks tsdk for me too. It cannot loads correct in my rush monorepo. The symptoms are identical to those reported above. Tried to set typescript.tsdk to the following values but none of them works.

  • common/temp/node_modules/typescript/lib
  • ./common/temp/node_modules/typescript/lib
  • C:/path/to/project/common/temp/node_modules/typescript/lib (absolute path)

Rolling back to 1.3.x won't solve this problem for me (tried 1.3.19, 1.3.16).

@johnsoncodehk johnsoncodehk added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Apr 21, 2023
@johnsoncodehk
Copy link
Member

Please try v1.4.1.

@wenyongda
Copy link

It's normal.Thank you very much

@Anoesj
Copy link
Author

Anoesj commented Apr 21, 2023

I can confirm it's working again, thanks for the super fast response @johnsoncodehk ❤️

@Tanimodori
Copy link

It works for me in 1.4.1. Thanks for the quick fix! ❤️

@0biWanKenobi
Copy link

0biWanKenobi commented Apr 21, 2023

Sorry but it's still broken for me, I have x.x.x (takeover) in the bottom toolbar and this error when opening the TS version picker:
image

I am on Windows, vue-tsc version 0.31.4

[edit]: rolling back to Volar 1.2.0 solved it. Apparently Volar 1.4.1 is no longer compatible with older versions of vue-tsc?

@rajeshtva
Copy link

Apparently broken on my system as well..
volar version: 1.4.2

Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in /home/rex/.vscode/extensions/ms-vscode.vscode-typescript-next-5.1.20230421/extensions/node_modules/typescript/lib
[Error - 12:04:51] Server initialization failed.
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in /home/rex/.vscode/extensions/ms-vscode.vscode-typescript-next-5.1.20230421/extensions/node_modules/typescript/lib
  Code: -32603 
[Error - 12:04:51] Vue Semantic Server client: couldn't create connection to server.
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in /home/rex/.vscode/extensions/ms-vscode.vscode-typescript-next-5.1.20230421/extensions/node_modules/typescript/lib
  Code: -32603 

@Eyre-S
Copy link

Eyre-S commented Apr 22, 2023

Apparently broken on my system as well.. volar version: 1.4.2

Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in /home/rex/.vscode/extensions/ms-vscode.vscode-typescript-next-5.1.20230421/extensions/node_modules/typescript/lib
[Error - 12:04:51] Server initialization failed.
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in /home/rex/.vscode/extensions/ms-vscode.vscode-typescript-next-5.1.20230421/extensions/node_modules/typescript/lib
  Code: -32603 
[Error - 12:04:51] Vue Semantic Server client: couldn't create connection to server.
  Message: Request initialize failed with message: Can't find typescript.js or tsserverlibrary.js in /home/rex/.vscode/extensions/ms-vscode.vscode-typescript-next-5.1.20230421/extensions/node_modules/typescript/lib
  Code: -32603 

There's the same problem on my computer.

seems volar trying to find typescript lib on ~/.vscode/extensions/ms-vscode.vscode-typescript-next-5.1.20230421/extensions/node_modules/typescript/lib but the actuall file location is ~/.vscode/extensions/ms-vscode.vscode-typescript-next-5.1.20230421/node_modules/typescript/lib.

I solved this problem by rolling back my volar version from 1.4.2 to 1.4.1.

@H0nGzA1
Copy link

H0nGzA1 commented Apr 22, 2023

image

image

for me select this it's working

@yingpwu
Copy link

yingpwu commented Apr 22, 2023

Change the extension of Vue Language Features (Volar) and TypeScript Vue Plugin (Volar) from version 1.4.2 to 1.4.1 will backto work ,
This problem confused me 2 hours ,mygod......
I turn off the autoupdate now

@johnsoncodehk
Copy link
Member

johnsoncodehk commented Apr 22, 2023

The correct issue is #2663, it should be fixed and released in v1.4.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

No branches or pull requests

9 participants