typescriptvisual-studio-codetsserver

Error upon starting tsserver in VS Code: "TSServer exited. Code: null. Signal: SIGTERM"


When starting tsserver vs code fails although it picks up the right version.

2023-08-25 16:18:16.644 [info] Starting TS Server undefined
2023-08-25 16:18:16.644 [info] Using tsserver from: c:\Users\Stratos\Desktop\QA\repos\lh\cypress\node_modules\typescript\lib\tsserver.js undefined
2023-08-25 16:18:16.644 [info] <syntax> Forking...
2023-08-25 16:18:16.644 [info] <syntax> Starting...
2023-08-25 16:18:16.644 [info] <semantic> Forking...
2023-08-25 16:18:16.644 [info] <semantic> Starting...
2023-08-25 16:18:16.645 [error] TSServer exited. Code: null. Signal: SIGTERM

enter image description here

From the settings.json:

"typescript.tsdk": "c:\\Users\\Stratos\\Desktop\\QA\\repos\\lh\\cypress\\node_modules\\typescript\\lib",

Actual file path:

C:\Users\Stratos\Desktop\QA\repos\lh\cypress\node_modules\typescript\lib\tsserver.js


Solution

  • The issue ticket where this is being tracked is TSServer exited #191441.

    One user reports that they are able to work around the issue by reloading VS Code with extensions disabled (use the Developer: Reload with Extensions Disabled command in the command palette), then closing VS Code, and then reopening it. Since that works, I also wonder if using the TypeScript: Restart TS Server or TypeScript: Reload Project commands in the command palette work. It might also have to do with running in WSL.

    One user reports that they get a similar issue when they simultaneously enable the Deno extension.