Failed to start Vitest. Check the output for more details. Vitest WebSocket connection closed, cannot call RPC anymore.
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- nodejs, typescript, vscode
- Domain
- devtools, testing-qa
Research direction
The error originates in the extension's worker.js and involves WebSocket/RPC communication with Vitest. Start by examining the extension's source for spawning processes and handling WebSocket connections, particularly in the API module. Look at the config loading flow and the birpc error handling. Reproduce the issue in a minimal environment to see if it's related to recent VSCode updates or Vitest version mismatches.
Written by the indexing model from the issue text.
Description
Describe the bug
I did not make any changes to our Vitest installation or config in 2 months. We've also been using Proto tools alongside Vitest for quite some time and had no issue before. Today it suddenly won't start up. I have installed the latest VSCode 1.139.0. Wonder if that could be the source.
Expected behavior
It should start without any error.
Reproduction
I created an minimal project with the bun init and installed the vitest as dev dependency. Reload the window via F1, and the error showed up.
Output
[INFO 17:39:55] [v1.52.0] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 17:39:55] [API] Using user root config: /Users/***/***/vitest.config.ts
[INFO 17:39:56] [API] Resolving configs: ***/vitest.config.ts
[17:39:56] [API] Spawning on-demand process...
[INFO 17:39:56] [API] Running Vitest v4.1.10 (***/vitest.config.ts) with "/Users/***/.proto/shims/node /Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/worker.js"
[17:39:58] [API] Vitest WebSocket connection closed, cannot call RPC anymore.
[17:39:58] [API] On-demand process finished in 2327ms
[Error 17:39:58] There were errors during config load.
[Error 17:39:58] [Error Error] [birpc] rpc is closed, cannot call "getFiles"
Error: [birpc] rpc is closed, cannot call "getFiles"
at /Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/esm-219GbSo2.js:1:1011
at Map.forEach (<anonymous>)
at Proxy.b (/Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/esm-219GbSo2.js:1:974)
at e.<anonymous> (/Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/extension.js:1:66879)
at e.wrapper (node:events:639:12)
at e.emit (node:events:526:24)
at e.emitClose (/Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/esm-219GbSo2.js:1:29396)
at Socket.X (/Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/esm-219GbSo2.js:1:39502)
at Socket.emit (node:events:514:28)
at TCP.<anonymous> (node:net:362:12)
[Error 17:39:59] Error: The extension could not load any config.
at tn (/Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/extension.js:1:79360)
at async lr._defineTestProfiles (/Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/extension.js:24:5481)
at async lr.defineTestProfiles (/Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/extension.js:24:4769)
at async lr.activate (/Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/extension.js:24:13636)
at async sr (/Users/***/.vscode/extensions/vitest.explorer-1.52.0/dist/extension.js:24:3397)
at async zb._activate (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:164:16021)
at async zb._waitForDepsThenActivate (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:164:15963)
at async zb._initialize (file:///Applications/Visual%20Studio%20Code.app/Contents/Resources/app/out/vs/workbench/api/node/extensionHostProcess.js:164:15330)
Extension Version
1.52.0
Vitest Version
4.1.10 in our monorepo, 5.0.1 in the test folder
Validations
- Check that you are using the latest version of the extension
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
- Dominant language
- TypeScript
- Stars
- 932
- Forks
- 124
- Avg merge
- 18h 28m
- Merged PRs (30d)
- 4
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from vitest-dev/vscode
-
pending triage
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
vitest-dev/vscode#776 · 1 reaction ·
-
p3-minor-bug
Difficulty 3/5 1-2 days Newbie friendliness 65/100
vitest-dev/vscode#823 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
vitest-dev/vscode#822 ·
-
enhancement: pending triage
Difficulty 3/5 1-2 days Newbie friendliness 68/100
vitest-dev/vscode#821 ·
-
pending triage
Difficulty 3/5 1-2 days Newbie friendliness 70/100
vitest-dev/vscode#812 ·
All issues in vitest-dev/vscode
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
chaitin/MonkeyCode#1437 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
carbon-design-system/carbon-ai-chat#2615 ·
Maintainers usually reply within 1 day
-
e2e-failure ready-to-code
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
redhat-developer/rhdh-plugin-export-overlays#4486 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug]: fileUploadMatrix.test.ts URL case does a real DNS lookup and fails offlinePossibly taken @r2jaff claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ComposioHQ/composio#5054 ·
Maintainers usually reply within 1 day