language-tools icon indicating copy to clipboard operation
language-tools copied to clipboard

VS Code extension causing JS/TS language service crashes last couple of days

Open ahkelly opened this issue 1 year ago • 4 comments

Describe the bug

type intellisense is perpetually in "loading state" and the VS code typescript plugin is repeatedly crashing returning ultimately the following notice.

"The JS/TS language service crashed 5 times in the last 5 Minutes. This may be caused by a plugin contributed by one of these extensions: svelte.svelte-vscode Please try disabling these extensions before filing an issue against VS Code."

image

image

Reproduction

Install vs code in wsl ubuntu and a normal svelte install with default options (svelte 4) using javascript with JSDoc checking.

jsconfig.json

{
	"extends": "./.svelte-kit/tsconfig.json",
	"compilerOptions": {
		"allowJs": true,
		"checkJs": true,
		"esModuleInterop": true,
		"forceConsistentCasingInFileNames": true,
		"resolveJsonModule": true,
		"skipLibCheck": true,
		"sourceMap": true,
		"strict": true,
		"moduleResolution": "bundler"
	}
	// Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias
	// except $lib which is handled by https://kit.svelte.dev/docs/configuration#files
	//
	// If you want to overwrite includes/excludes, make sure to copy over the relevant includes/excludes
	// from the referenced tsconfig.json - TypeScript does not merge them in
}

Expected behaviour

Normal behaviour is the language server not crashing in vs code.

System Info

  • OS: WSL: Ubuntu-22.04
  • IDE: VSCode
  • svelte-vscode v109.0.0

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

ahkelly avatar Sep 06 '24 16:09 ahkelly

I can't reproduce this can you follow this instruction to get the log of TSServer and see if there is any error in it? https://github.com/microsoft/TypeScript/wiki/Getting-logs-from-TS-Server-in-VS-Code

jasonlyu123 avatar Sep 07 '24 03:09 jasonlyu123

Hallelujah! I believe I have found the culprit. I took a look at any major changes I may have made in last few days that could have also contributed to it and I remembered I started integrating google cloud apis into our application which I disabled because at build time I was getting the ugly circular reference node error as mentioned and unresolved here

https://github.com/googleapis/google-auth-library-nodejs/issues/1539

I reverted my code but left the packages installed so I could get back to this once finding a resolution. These packages (all from google) were

  • @google-analytics/data
  • googleapis
  • @googleapis/searchconsole

I removed them today completely and restarted vs code and presto problem solved so they were clashing with this extension (not sure which one or all of them)

ahkelly avatar Sep 07 '24 17:09 ahkelly

I still can't reproduce the problem with all three libraries installed. But seems like you have solved your issue so I'll close this in a few days if there is no further info we can investigate.

jasonlyu123 avatar Sep 08 '24 01:09 jasonlyu123

OK, So the issue does still pop-up from time to time but not always like it was before I uninstalled the aforementioned packages. The only somewhat consistent thing I can see that "may" be the cause is that whenever I have some invalid JavaScript code (invalid expression or function for example) this seems to trigger the freak out if I leave the code uncorrected for an extended period of time.

Info 1319 [15:38:25.490] Starting updateGraphWorker: Project: /home/andrewk/sites/cj-app-sveltekit/jsconfig.json
Err 1320  [15:38:25.490] Exception on executing command {
  "seq": 119,
  "type": "request",
  "command": "quickinfo",
  "arguments": {
    "file": "/home/andrewk/sites/cj-app-sveltekit/src/routes/app/api/report/purchase_order/+server.js",
    "line": 21,
    "offset": 28
  }
}:

    Debug Failure. False expression.

Sounds like it may be something unique to my installation so probably not worth looking any further until I can reliably find more reproduction steps and I am not going to spam you with the tons of log data that has been generated as most of it is INFO lines and I don't see much in there that stands out.

ahkelly avatar Sep 10 '24 21:09 ahkelly

I get this problem on a semi-regular basis. Is there somewhere we can look in VSCode to get more information? I tried looking in the "output" panel and I see this:

2024-12-04 14:11:15.105 [info] Starting TS Server
2024-12-04 14:11:15.105 [info] Using tsserver from: /home/<name>/.vscode-server/bin/f1a4fb101478ce6ec82fe9627c43efbf9e98c813/extensions/node_modules/typescript/lib/tsserver.js
2024-12-04 14:11:15.105 [info] <syntax> Forking...
2024-12-04 14:11:15.105 [info] <syntax> Starting...
2024-12-04 14:11:15.105 [info] <semantic> Forking...
2024-12-04 14:11:15.105 [info] <semantic> Starting...
2024-12-04 14:11:59.588 [error] TSServer exited. Code: null. Signal: SIGABRT

but that's not very informative.

roblframpton avatar Dec 04 '24 14:12 roblframpton

@roblframpton https://github.com/sveltejs/language-tools/issues/2489#issuecomment-2335018482

jasonlyu123 avatar Dec 04 '24 14:12 jasonlyu123

@jasonlyu123

@roblframpton #2489 (comment)

That doesn't work, I think it's out of date. There is no such command in my version of VS Code.

I also tried looking at the log file on disk, but that shows the same thing I see in my output panel.

EDIT: Ah, I see the problem with the logs. If the server doesn't initialize, the "Open TS Server log" obviously won't appear. I'll try enabling the logs and see if it crashes again later.

roblframpton avatar Dec 04 '24 14:12 roblframpton

Closing due to inactivity and lack of reproduction.

jasonlyu123 avatar Mar 10 '25 06:03 jasonlyu123