Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS/Ts language service keeps crashing when opening plain JS files #178447

Closed
gfraser-solink opened this issue Mar 27, 2023 · 9 comments
Closed

JS/Ts language service keeps crashing when opening plain JS files #178447

gfraser-solink opened this issue Mar 27, 2023 · 9 comments
Assignees
Labels
info-needed Issue requires more information from poster *not-reproducible Issue cannot be reproduced by VS Code Team member as described

Comments

@gfraser-solink
Copy link

Type: Bug

Most files in our projects are TS but opening certain JS files causes the JS/TS language service to keep crashing, causing VS Code to consume signficant battery power consistently. The only way to stop the service from crashing is to restart VS Code and refrain from opening any JS files and only stick to TS files.

VS Code version: Code 1.76.2 (Universal) (ee2b180, 2023-03-14T17:54:09.061Z)
OS version: Darwin arm64 22.3.0
Modes:
Sandboxed: No

System Info
Item Value
CPUs Apple M2 Pro (12 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: disabled_off
Load (avg) 3, 2, 2
Memory (System) 16.00GB (2.24GB free)
Process Argv --crash-reporter-id 7fd2c184-bb1e-4e50-a0f4-fb174bf49e96
Screen Reader no
VM 0%
Extensions (8)
Extension Author (truncated) Version
vscode-jest-runner fir 0.4.60
python ms- 2023.4.1
vscode-pylance ms- 2023.3.30
jupyter ms- 2023.2.1200692131
jupyter-keymap ms- 1.1.0
jupyter-renderers ms- 1.0.15
vscode-jupyter-cell-tags ms- 0.1.8
vscode-jupyter-slideshow ms- 0.1.5
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
pythonvspyl392:30443607
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
pythondataviewer:30285071
vscod805:30301674
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vsclangdc:30486549
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
pyindex848:30662994
nodejswelcome1:30587005
282f8724:30602487
pyind779:30671433
89544117:30613380
pythonsymbol12:30671437
pythonb192cf:30669361
functionswalk:30687959
pythonms35:30686772

@mosesfawole
Copy link

This issue could be caused by a variety of factors, such as outdated extensions, conflicting extensions.

  • Update your extensions, You can check for updates by going to the Extensions panel and clicking the "Update All" button.
  • Disable conflicting extensions: Try disabling any other extensions that may be conflicting with the TypeScript and JavaScript language service. You can do this by going to the Extensions panel and disabling the extensions one by one until the issue is resolved
    -Increase resources: If your machine has limited resources, you can try increasing the resources available to VS Code. You can do this by modifying the "max_memory_restart" and "max_old_space_size" settings in the VS Code settings.json file.

You can try any of these, hopefully it works

@mjbvz
Copy link
Collaborator

mjbvz commented Mar 27, 2023

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

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Mar 27, 2023
@mjbvz mjbvz self-assigned this Mar 27, 2023
@mosesfawole
Copy link

Yeah it should reproduce in the insiders build 🤔

@gfraser-solink
Copy link
Author

My extensions are up to date. It's definitely not a system specs or resources issue either. Is there a way to enable verbose logging or something so we can see the reason it's crashing?

@mosesfawole
Copy link

Open the VS Code settings
Search for "typescript" or "javascript" in the search bar.
Under the "Editor: JavaScript" or "Editor: TypeScript" section, click on the "Edit in settings.json" link.
In the settings.json file, add the following line: "typescript.tsserver.log": "verbose" (for TypeScript) or "javascript.serve.log": "verbose" (for JavaScript).
Save the settings.json file and restart VS Code.
After enabling verbose logging, you should be able to see more detailed error message in the output panel when it crashes

@hasanayan
Copy link

Sharing this hoping it provides some additional info;

we had a similar problem, at the end we figured including those js files in any of the tsconfig.json files in the project fixed this issue.

However, we are still running into this language server crash->reinitialize loop and we are unable to find the cause of this now. There still are many js files in the repo that are not included by any of the tsconfig.json files because they are our build artifacts. And although we open any js files, sometimes we still get into that loop on vscode.

I have opened an issue about this microsoft/TypeScript#53574

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 4, 2023

@gfraser-solink Did you test in the latest VS Code insiders build with all extensions disabled?

@gfraser-solink
Copy link
Author

I'm not on the insiders build. This is the build I'm on currently and the issue is still occurring. It hasn't been a big enough issue for me to try a different build though since most of my work is in TS and those files work fine.

Version: 1.76.2 (Universal)
Commit: ee2b180
Date: 2023-03-14T17:54:09.061Z

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 4, 2023

Sorry but we really need you to test on insiders with extensions disabled. I'll close this if it's not a big issue

@mjbvz mjbvz closed this as completed Apr 4, 2023
@mjbvz mjbvz added the *not-reproducible Issue cannot be reproduced by VS Code Team member as described label Apr 4, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 19, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster *not-reproducible Issue cannot be reproduced by VS Code Team member as described
Projects
None yet
Development

No branches or pull requests

4 participants