vscode icon indicating copy to clipboard operation
vscode copied to clipboard

VS Code Vitest extension fails to load configs with repeated spawn EINVAL errors

Open hafsahjilanee opened this issue 5 months ago • 5 comments

Describe the bug

I have a monorepo where each package is configured with Vitest. I’m able to run tests from the terminal without issues. However, since I want to debug tests, I installed the Vitest extension in VS Code.

The Vitest extension (v1.26.3) activates as expected, detecting multiple vitest.config.* files across the workspace.

However, when attempting to run Vitest (v3.2.2) using internal shims, the extension encounters repeated spawn EINVAL errors during config loading.

As a result, the extension fails to load any test configuration, preventing test discovery and execution.

The full stack trace shows ChildProcess.spawn throwing EINVAL during the config resolution process: [Error 9:47:48 AM] [Error Error] The extension could not load any config. Error: The extension could not load any config.

Image

Reproduction

Steps to Reproduce:

Open workspace containing multiple Vitest config files.

Activate Vitest extension or open Vitest Explorer.

Observe errors in VS Code output / extension logs related to spawn EINVAL.

Output

[INFO 9:47:45 AM] [v1.26.3] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 9:47:46 AM] [API] Resolving configs: utils/vitest.config.js, veson-jobs-service/vitest.config.ts, veson-jobs-service/vitest.config.integration.ts, veson-jobs-service/vitest.config.e2e.ts, connect-api/vitest.config.ts, nest-platform/vitest.config.ts, nest-platform-testing/vitest.config.ts, connect/vitest.config.ts, integration-tests/vitest.config.integration.ts
[INFO 9:47:46 AM] [API] Running Vitest v3.2.2 (utils/vitest.config.js) with "C:\Users\hjilanee\AppData\Local\mise\shims\node.CMD C:/Users/hjilanee/.vscode/extensions/vitest.explorer-1.26.3/dist/worker.js"
[INFO 9:47:46 AM] [API] Running Vitest v3.2.2 (veson-jobs-service/vitest.config.ts) with "C:\Users\hjilanee\AppData\Local\mise\shims\node.CMD C:/Users/hjilanee/.vscode/extensions/vitest.explorer-1.26.3/dist/worker.js"
[INFO 9:47:46 AM] [API] Running Vitest v3.2.2 (veson-jobs-service/vitest.config.integration.ts) with "C:\Users\hjilanee\AppData\Local\mise\shims\node.CMD C:/Users/hjilanee/.vscode/extensions/vitest.explorer-1.26.3/dist/worker.js"
[INFO 9:47:46 AM] [API] Running Vitest v3.2.2 (veson-jobs-service/vitest.config.e2e.ts) with "C:\Users\hjilanee\AppData\Local\mise\shims\node.CMD C:/Users/hjilanee/.vscode/extensions/vitest.explorer-1.26.3/dist/worker.js"
[INFO 9:47:46 AM] [API] Running Vitest v3.2.2 (connect-api/vitest.config.ts) with "C:\Users\hjilanee\AppData\Local\mise\shims\node.CMD C:/Users/hjilanee/.vscode/extensions/vitest.explorer-1.26.3/dist/worker.js"
[Error 9:47:46 AM] There were errors during config load.
[Error 9:47:46 AM] [Error Error] spawn EINVAL
Error: spawn EINVAL
	at ChildProcess.spawn (node:internal/child_process:420:11)
	at spawn (node:child_process:787:9)
	at xl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:1223)
	at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
	at async kl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:12369)
	at async Nl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:10897)
	at async Li._defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:2314)
	at async Li.defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:1701)
	at async Li.activate (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:7158)
	at async VE (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:662)
	at async db.n (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13386)
	at async db.m (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13349)
	at async db.l (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:12805)
[Error 9:47:46 AM] [Error Error] spawn EINVAL
Error: spawn EINVAL
	at ChildProcess.spawn (node:internal/child_process:420:11)
	at spawn (node:child_process:787:9)
	at xl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:1223)
	at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
	at async kl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:12369)
	at async Nl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:10897)
	at async Li._defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:2314)
	at async Li.defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:1701)
	at async Li.activate (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:7158)
	at async VE (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:662)
	at async db.n (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13386)
	at async db.m (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13349)
	at async db.l (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:12805)
[Error 9:47:46 AM] [Error Error] spawn EINVAL
Error: spawn EINVAL
	at ChildProcess.spawn (node:internal/child_process:420:11)
	at spawn (node:child_process:787:9)
	at xl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:1223)
	at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
	at async kl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:12369)
	at async Nl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:10897)
	at async Li._defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:2314)
	at async Li.defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:1701)
	at async Li.activate (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:7158)
	at async VE (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:662)
	at async db.n (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13386)
	at async db.m (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13349)
	at async db.l (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:12805)
[Error 9:47:46 AM] [Error Error] spawn EINVAL
Error: spawn EINVAL
	at ChildProcess.spawn (node:internal/child_process:420:11)
	at spawn (node:child_process:787:9)
	at xl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:1223)
	at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
	at async kl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:12369)
	at async Nl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:10897)
	at async Li._defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:2314)
	at async Li.defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:1701)
	at async Li.activate (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:7158)
	at async VE (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:662)
	at async db.n (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13386)
	at async db.m (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13349)
	at async db.l (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:12805)
[Error 9:47:46 AM] [Error Error] spawn EINVAL
Error: spawn EINVAL
	at ChildProcess.spawn (node:internal/child_process:420:11)
	at spawn (node:child_process:787:9)
	at xl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:1223)
	at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
	at async kl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:12369)
	at async Nl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:10897)
	at async Li._defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:2314)
	at async Li.defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:1701)
	at async Li.activate (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:7158)
	at async VE (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:662)
	at async db.n (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13386)
	at async db.m (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13349)
	at async db.l (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:12805)
[Error 9:47:48 AM] [Error Error] The extension could not load any config.
Error: The extension could not load any config.
    at Nl (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:13:11233)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at Li._defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:2314)
    at Li.defineTestProfiles (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:1701)
    at Li.activate (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:7158)
    at VE (c:\Users\hjilanee\.vscode\extensions\vitest.explorer-1.26.3\dist\extension.js:25:662)
    at db.n (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13386)
    at db.m (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:13349)
    at db.l (file:///c:/Users/hjilanee/AppData/Local/Programs/Microsoft%20VS%20Code/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:112:12805)

Extension Version

1.26.3

Vitest Version

3.2.2

Validations

hafsahjilanee avatar Jul 30 '25 19:07 hafsahjilanee