microsoft / vscode

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

The JS/TS language service immediately crashed 5 times. The service will not be restarted. #206780

Closed myusril closed 2 days ago

myusril commented 3 months ago

Type: Bug

I always get an error message like the title of this report whenever I run Visual Studio Code on an Express.js project with TypeScript. I don't know if this is because of my Visual Studio Code or because of the Extension I installed.

VS Code version: Code 1.87.0 (019f4d1419fbc8219a181fab7892ebccf7ee29a2, 2024-02-27T23:42:16.599Z) OS version: Linux x64 6.5.0-21-generic Modes:

System Info |Item|Value| |---|---| |CPUs|Intel(R) Core(TM) i3-10100F CPU @ 3.60GHz (8 x 4099)| |GPU Status|2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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: disabled_software
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off| |Load (avg)|0, 1, 1| |Memory (System)|15.55GB (9.80GB free)| |Process Argv|. --crash-reporter-id efe0e984-7151-4c25-9ebf-c39358e686a5| |Screen Reader|no| |VM|0%| |DESKTOP_SESSION|ubuntu| |XDG_CURRENT_DESKTOP|Unity| |XDG_SESSION_DESKTOP|ubuntu| |XDG_SESSION_TYPE|x11|
Extensions (41) Extension|Author (truncated)|Version ---|---|--- better-comments|aar|3.0.2 laravel-blade-spacer|aus|2.3.0 vscode-intelephense-client|bme|1.10.2 path-intellisense|chr|2.8.5 laravel-goto-view|cod|1.3.11 bracket-pair-colorizer-2|Coe|0.2.4 composer-php-vscode|DEV|1.45.15061 intelli-php-vscode|DEV|0.12.15062 phptools-vscode|DEV|1.45.15061 profiler-php-vscode|DEV|1.45.15061 gitlens|eam|14.8.2 prettier-vscode|esb|10.1.0 auto-close-tag|for|0.5.15 auto-rename-tag|for|0.1.10 code-runner|for|0.12.1 php-awesome-snippets|hak|1.1.3 output-colorizer|IBM|0.1.2 prettier-sql-vscode|inf|1.6.0 php-namespace-resolver|Meh|1.1.9 dotenv|mik|1.0.1 theme-monokai-pro-vscode|mon|1.2.2 vscode-docker|ms-|1.29.0 vscode-typescript-next|ms-|5.5.20240303 indent-rainbow|ode|8.3.1 laravel-blade|one|1.35.1 laravel5-snippets|one|1.17.0 vscode-jest|Ort|6.2.2 material-icon-theme|PKi|4.34.0 polacode|pnp|0.3.4 postman-for-vscode|Pos|0.18.0 prisma|Pri|5.10.2 vscode-thunder-client|ran|2.18.0 LiveServer|rit|5.7.9 laravel-artisan|rya|0.0.31 code-settings-sync|Sha|3.4.3 vscode-blade-formatter|shu|0.24.2 ayu|tea|1.0.5 errorlens|use|3.16.0 highlight-matching-tag|vin|0.11.0 quokka-vscode|Wal|1.0.627 material-theme|zhu|3.16.2 (2 theme extensions excluded)
A/B Experiments ``` vsliv368:30146709 vspor879:30202332 vspor708:30202333 vspor363:30204092 vscorecescf:30445987 vscod805cf:30301675 binariesv615:30325510 vsaa593:30376534 py29gd2263:30899288 c4g48928:30535728 azure-dev_surveyone:30548225 962ge761:30959799 pythongtdpath:30769146 welcomedialog:30910333 pythonidxpt:30866567 pythonnoceb:30805159 asynctok:30898717 pythontestfixt:30902429 pythonregdiag2:30936856 pyreplss1:30897532 pythonmypyd1:30879173 pythoncet0:30885854 pythontbext0:30879054 dsvsc016:30899300 dsvsc017:30899301 dsvsc018:30899302 pydisww2:30959801 d34g3935:30971562 edj9j583:30969295 fegfb526:30973843 e3gdj431:30958358 78248357:30976999 ccp1r3:30958155 dsvsc020:30976470 ```
davidmatter commented 3 months ago

Does it work for you with vscode insiders edition? Might be related to Node version 18.17.1

myusril commented 3 months ago

@davidmatter I don't know about the vscode insider version. But do you think I need to upgrade my Node.js version to version 20?

davidmatter commented 3 months ago

Try running your project with https://code.visualstudio.com/insiders/ The relevant node version is the one that vscode ships with.

myusril commented 3 months ago

@davidmatter All right. I'll try to run my project using vscode insider edition

jbaccarelli-equinix commented 1 month ago

Try running your project with https://code.visualstudio.com/insiders/ The relevant node version is the one that vscode ships with.

hi @davidmatter i have this same issue and this error doesn't happen with insiders, how does that help? Also, if i use insiders the problem is that eslint stops working properly (takes forever to apply auto-fixes)

I tried completely purging vscode from my mac and disabling all extensions and this error still occurs.

I have a yarn monorepo that uses TS for several packages, any ideas?

davidmatter commented 1 month ago

If it's a large project you can try to fiddle with this setting typescript.tsserver.maxTsServerMemory

davidmatter commented 1 month ago

AFAIK, in the current insider version they've updated the node version to the current LTS. That might help with memory usage. Might need to wait until they've stabilized and shipped the insider version. Maybe increasing maxTsServerMemory helps, though.

jbaccarelli-equinix commented 1 month ago

AFAIK, in the current insider version they've updated the node version to the current LTS. That might help with memory usage. Might need to wait until they've stabilized and shipped the insider version. Maybe increasing maxTsServerMemory helps, though.

it's big in deed, but for now the link to the yarn repo issue with the fix abotu disabling the tsserver feature helped :) I wish i had found that before purging vscode without correctly backing up my settings though lol

davidmatter commented 1 month ago

Why disable? I'd just increase it to 4GB which is the max size AFAIK

jbaccarelli-equinix commented 1 month ago

Why disable? I'd just increase it to 4GB which is the max size AFAIK

just tried and it still crashes: "typescript.tsserver.maxTsServerMemory": 4096" i have 16gb of ram in total

mjbvz commented 2 days ago

Closing as we haven't heard back from the original poster. I suspect the crash was either caused by an extension of by yarn