cursor icon indicating copy to clipboard operation
cursor copied to clipboard

JS/TS language features/server keeps crashing.

Open tzjames opened this issue 1 year ago • 6 comments

Type: Bug

Initializing JS/TS language features plugin keeps crashing. It eats up my CPU. As long as I am currently on a .ts file it seems to do it.

VS Code version: Cursor 0.40.4 (63dae81aea2c3fc079420fe72578a8eef26ba870, 2024-09-05T02:52:05.660Z) OS version: Darwin arm64 23.5.0 Modes:

System Info
Item Value
CPUs Apple M2 Max (12 x 2400)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 8, 8, 7
Memory (System) 32.00GB (0.20GB free)
Process Argv
Screen Reader no
VM 0%
Extensions (24)
Extension Author (truncated) Version
jupyter-keymap ms- 1.1.2
pyright any 1.1.327
gitlens eam 15.4.0
prettier-vscode esb 11.0.0
vscode-github-actions git 0.26.3
vscode-pull-request-github Git 0.92.0
go gol 0.42.0
terraform has 2.32.3
svg joc 1.5.4
vscode-docker ms- 1.29.2
debugpy ms- 2024.6.0
python ms- 2024.12.3
vscode-pylance ms- 2024.8.1
jupyter ms- 2024.6.0
jupyter-renderers ms- 1.0.19
vscode-jupyter-cell-tags ms- 0.1.9
vscode-jupyter-slideshow ms- 0.1.6
remote-containers ms- 0.327.0
live-server ms- 0.4.14
makefile-tools ms- 0.10.26
vscode-typescript-next ms- 5.7.20240904
vscode-jest Ort 6.2.5
vscode-coverage-gutters rya 2.11.1
eno Wsc 2.3.53

tzjames avatar Sep 13 '24 06:09 tzjames

Can you check the Output tab (CTRL+Shift+M) and choose the "TypeScript" option in the dropdown, and see if there are any errors or crashing in there?

It's hard to diagnose from your system info and extensions alone, without knowing what the crash actually is, thanks :)

danperks avatar Sep 18 '24 14:09 danperks

Mine occasionally gets into a state like this while I'm editing code and occasionally using the tab completion. I haven't narrowed down a repro yet, but I do see this semi-regularly.

2024-09-19 12:35:26.044 [error] TSServer exited. Code: null. Signal: SIGABRT
2024-09-19 12:35:26.045 [info] Starting TS Server
2024-09-19 12:35:26.045 [info] Using tsserver from: <repo_path>/node_modules/typescript/lib/tsserver.js
2024-09-19 12:35:26.045 [info] <syntax> Forking...
2024-09-19 12:35:26.045 [info] <syntax> Starting...
2024-09-19 12:35:26.045 [info] <semantic> Forking...
2024-09-19 12:35:26.045 [info] <semantic> Starting...
2024-09-19 12:35:30.824 [error] TSServer exited. Code: null. Signal: SIGTERM
2024-09-19 12:35:30.824 [info] Starting TS Server
2024-09-19 12:35:30.824 [info] Not starting server: disposed
2024-09-19 12:35:32.982 [info] Starting TS Server
2024-09-19 12:35:32.983 [info] Using tsserver from: <repo_path>/node_modules/typescript/lib/tsserver.js
2024-09-19 12:35:32.983 [info] <syntax> Forking...
2024-09-19 12:35:32.983 [info] <syntax> Starting...
2024-09-19 12:35:32.983 [info] <semantic> Forking...
2024-09-19 12:35:32.983 [info] <semantic> Starting...
2024-09-19 12:38:42.250 [error] TSServer exited. Code: null. Signal: SIGABRT
2024-09-19 12:38:42.250 [info] Starting TS Server
2024-09-19 12:38:42.250 [info] Using tsserver from: <repo_path>/node_modules/typescript/lib/tsserver.js
2024-09-19 12:38:42.250 [info] <syntax> Forking...
2024-09-19 12:38:42.250 [info] <syntax> Starting...
2024-09-19 12:38:42.250 [info] <semantic> Forking...
2024-09-19 12:38:42.250 [info] <semantic> Starting...

MatthewMaclean avatar Sep 19 '24 17:09 MatthewMaclean

At least with the error you are facing @MatthewMaclean , this appears to be a general issue with the TSServer that affects Code, the underlying OSS app that VSCode and Cursor is based off. I'd recommend tracking some of the issues in their repo as a few resolution suggestions have been made there.

A few people have said that reloading Cursor (/VSCode) without extensions stops it crashing, but no-one has found which extension(s) seem to cause this issue. It's also suggested that the TS Server may be running out of memory on big projects.

I'll close this for now, as it's highly unlikely to be a Cursor bug - at most, if the bug is fixed in Code, it may just need a version bump of Code in a later version of Cursor.

For reference: VSCode #161291 VSCode #171157 VSCode #191441 TypeScript #44951

danperks avatar Sep 19 '24 17:09 danperks

Interesting, at least based off of my experience, it happens way more frequently when using Cursor than I'd seen while using VSCode natively (but I agree VSCode/TS server have their own problems). I'd never seen warnings like The JS/TS language service crashed 5 times in the last 5 Minutes. before.

Is there additional information I could track down to see if it's Cursor specific?

MatthewMaclean avatar Sep 19 '24 18:09 MatthewMaclean

My guess with that is that Cursor uses an older version of VSCode (or technically Code, the OSS app that VSCode and Cursor is based on) under the hood, and it’s possible there are improvements to the usage of TSServer in newer VSCode releases that Cursor hasn’t yet got.

Especially if TSServer ships within VSCode/Cursor, it’s highly probable that my guess has at least some cause.

Try running Cursor with no extensions (“Relaunch without Extensions” is in the command palette) and compare it to VSCode then, as it could be an extension (or an older version of one compared to your VSCode installation) is causing some issues.

danperks avatar Sep 19 '24 22:09 danperks

Just for the record, anyone finding this: The extension "Import cost" did cause my extension host to crash constantly. I found out with the recommended bisect method. Uninstalling the extension did solve the problem.

moritzlaube avatar Oct 02 '24 20:10 moritzlaube

@moritzlaube Thank you! I've just found that it crashed at the moment when cursor.ai crashed. I have just uninstalled it 🤞 image

anetrebskii avatar Oct 06 '24 07:10 anetrebskii

Anyone else facing this, this is usually due to a bad extension that runs for JS/TS code, that crashes. Like the users above, check your logs to see if you can find the suspect extension!

If anyone's facing this on a fresh install, please create a new issue, thanks.

danperks avatar Oct 25 '24 01:10 danperks

@moritzlaube Thank you very much for your exploration experience, it has really helped me a lot. This problem has troubled me for a long time. I always thought it was a bug in Cursor, and at one point, I even wanted to give up on Cursor. Now it seems I was a bit foolishly worrying myself.😅

ilxqx avatar Nov 15 '24 15:11 ilxqx