microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.17k stars 28.54k forks source link

js/ts intelisense crashes repeadetly after a few minutes of starting VS Code #221424

Open GiSonny opened 1 month ago

GiSonny commented 1 month ago

Type: Bug

VS Code project set up: nvm, node.js (V^18), npm, typescript (V^5), webpack-dev-server (V^5)+ html-webpack-plugin(V^5). After loading VS Code, in a few minutes, I get the notification that intelisense for JS/TS has crached.

VS Code version: Code 1.91.0 (ea1445cc7016315d0f5728f8e8b12a45dc0a7286, 2024-07-01T18:52:22.949Z) OS version: Windows_NT x64 10.0.19045 Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz (8 x 4008)| |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
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|undefined| |Memory (System)|31.96GB (23.01GB free)| |Process Argv|--crash-reporter-id 2a774fd2-a773-463c-a4ff-9417e7dd95b6| |Screen Reader|no| |VM|57%|
Extensions (2) Extension|Author (truncated)|Version ---|---|--- npm-intellisense|chr|1.4.4 powershell|ms-|2023.5.0
mjbvz commented 1 month ago

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

If so, please try collecting the TS Server log from the crashed instance:

  1. Set "typescript.tsserver.log": "verbose"
  2. Restart VS Code and reproduce the problem
  3. Open the TypeScript section of the output panel
  4. At the very top, find the first line that prints to path to the semantic error log file. It should look something like:

    [Info  - 19:54:59.247] <semantic> Log file: /Users/matb/Library/Application Support/Code - Insiders/logs/20200213T104930/exthost55/vscode.typescript-language-features/tsserver-log-ZT2zau/tsserver.log

    That file contains the typescript logs.

Look through that log file for the first error or stack trace you see. If you can share the log, I can also take a look to see if anything stands out

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

GiSonny commented 1 month ago

It reproduces in the latest VS Code insiders build with all extensions disabled.

2024-07-13 09:09:16.494 [info] Starting TS Server 2024-07-13 09:09:16.494 [info] Using tsserver from: c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js 2024-07-13 09:09:16.494 [info] Log file: c:\Users\wwamp\AppData\Roaming\Code\logs\20240713T090914\window1\exthost\vscode.typescript-language-features\tsserver-log-iB0vnh\tsserver.log 2024-07-13 09:09:16.494 [info] Forking... 2024-07-13 09:09:16.494 [info] Starting... 2024-07-13 09:09:16.494 [info] Log file: c:\Users\wwamp\AppData\Roaming\Code\logs\20240713T090914\window1\exthost\vscode.typescript-language-features\tsserver-log-qiBhCb\tsserver.log 2024-07-13 09:09:16.494 [info] Forking... 2024-07-13 09:09:16.494 [info] Starting... 2024-07-13 09:10:14.999 [error] TSServer exited. Code: 134. Signal: null tsserver.log ti-4936.log

JasonKleban commented 3 weeks ago

I also have a project that has been plagued for years with tsserver crashing repeatedly. I can send the log file to the typescript team privately, or what can I look for in the log file?

[[timestamp]] [error] TSServer exited. Code: 134. Signal: null
[[timestamp]] [info] TSServer log file: c:\Users\[[me]]\..\[[semantic-last]]\tsserver.log
[[timestamp]] [info] Starting TS Server
[[timestamp]] [info] Using tsserver from: c:\code\...
[[timestamp]] [info] <syntax> Log file: c:\Users\[[me]]\...\[[syntax]]\tsserver.log
[[timestamp]] [info] <syntax> Forking...
[[timestamp]] [info] <syntax> Starting...
[[timestamp]] [info] <semantic> Log file: c:\Users\[[me]]\...\[[semantic]]\tsserver.log
[[timestamp]] [info] <semantic> Forking...
[[timestamp]] [info] <semantic> Starting...

[[timestamp]] [error] TSServer exited. Code: 134. Signal: null
[[timestamp]] [info] TSServer log file: c:\Users\[[me]]\..\[[semantic]]\tsserver.log
[[timestamp]] [info] Starting TS Server
[[timestamp]] [info] Using tsserver from: c:\code\...
[[timestamp]] [info] <syntax> Log file: c:\Users\[[me]]\...\[[syntax-next]]\tsserver.log
[[timestamp]] [info] <syntax> Forking...
[[timestamp]] [info] <syntax> Starting...
[[timestamp]] [info] <semantic> Log file: c:\Users\[[me]]\...\[[semantic-next]]\tsserver.log
[[timestamp]] [info] <semantic> Forking...
[[timestamp]] [info] <semantic> Starting...

I don't see any special mention of "134" "error" "tserror" "crash" in the log.

I notice this as the last line of the semantic ends consistently(?) at ~279K lines with:

Info 23436[11:25:30.212] FileWatcher:: Added:: WatchInfo: C:\code\...\node_modules\aws-sdk\package.json 2000 undefined Project: c:/code/.../tsconfig.json WatchType: File location affecting resolution

and that aws-sdk (v2.1528.0) package.json file doesn't have anything wrong with it that I notice.

That is last FileWatcher:: Added:: WatchInfo in a sequence of many that all appear about the same for different package.json files. I see aws-sdk (same version) mentioned many times previously as various script/module paths and even with one similar line but included from a different project. The very next line from THAT sequence is about @types\express-serve-static-core\package.json as it wraps up that batch of lines with Info 21856[11:35:39.982] Elapsed:: 0.04400000000168802ms that my crash never seems to reach.

Restarting VS Code rather than just TSServer can fix the issue for a while, but I'd love to help squash whatever bug this is, starting with capturing the actual error in the log.