vitest-dev / vscode

VS Code extension for Vitest
https://vitest.dev/vscode
MIT License
729 stars 79 forks source link

Always displaying vitest error on startup #414

Closed FernandoGonzalezHomerti closed 1 month ago

FernandoGonzalezHomerti commented 1 month ago

Describe the bug

When I always start VSCode, it appears to me a popup in the right-bottom of the screen saying: "There was an error during Vitest startup. Check the output for more details". And the error says something like: { code: 'ERR_MODULE_NOT_FOUND'}, when I have in my project installed vite and vitest as dev dependencies and the extension of vite and vitest of vscode enabled.

Reproduction

Captura de pantalla 2024-06-11 081046 Captura de pantalla 2024-06-11 081110

Output

Popup in the right-bottom of the screen saying: "There was an error during Vitest startup. Check the output for more details". And the error says something like: { code: 'ERR_MODULE_NOT_FOUND'}.

In Detail:

[INFO 8:10:35 AM] [API] Running Vitest v1.6.0 (superdispatcher/vitest.workspace.js) with Node.js: C:\Program Files\nodejs\node.EXE
[Worker] �[31mfailed to load config from C:\xampp\htdocs\superdispatcher\vendor\laravel\breeze\stubs\inertia-react\vite.config.js�[39
[Worker] �[31m�[1mError�[22m: Cannot find package '@vitejs/plugin-react' imported from C:\xampp\htdocs\superdispatcher\vendor\laravel\breeze\stubs\inertia-react\vite.config.js.timestamp-1718086237927-7c3b1f70d36b8.mjs�[39m
�[90m �[2m❯�[22m packageResolve node:internal/modules/esm/resolve:�[2m841:9�[22m�[39
[Worker] �[90m �[2m❯�[22m moduleResolve node:internal/modules/esm/resolve:�[2m914:18�[22m�[39m
�[90m �[2m❯�[22m defaultResolve node:internal/modules/esm/resolve:�[2m1119:11�[22m�[39m
�[90m �[2m❯�[22m ModuleLoader.defaultResolve node:internal/modules/esm/loader:�[2m542:12�[22m�[39
[Worker] �[90m �[2m❯�[22m ModuleLoader.resolve node:internal/modules/esm/loader:�[2m511:25�[22m�[39m
�[90m �[2m❯�[22m ModuleLoader.getModuleJob node:internal/modules/esm/loader:�[2m241:38�[22m�[39m
�[90m �[2m❯�[22m ModuleJob._link node:internal/modules/esm/module_job:�[2m126:49�[22m�[39m

�[31m�[2m⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯⎯�[22m�[39
[Worker] �[31m�[1mSerialized Error:�[22m�[39m �[90m{ code: 'ERR_MODULE_NOT_FOUND' }�[39
[Error 8:10:38 AM] [Error Error] Vitest process exited with code 1
Error: Vitest process exited with code 1
    at ChildProcess.d (c:\Users\fernando.gonzalez\.vscode\extensions\vitest.explorer-0.12.0\dist\extension.js:20:170)
    at ChildProcess.emit (node:events:514:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:294:12)```

Version

0.12.0

Validations

github-actions[bot] commented 1 month ago

Hello @FernandoGonzalezHomerti. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.

sheremet-va commented 1 month ago

Do you have @vitejs/plugin-react installed? Vitest cannot load the config.