Perhaps something weird; I have specified vitest version 2.0.5 in package.json and running with CLI works. Still the extension prints out vitest version 1.5.1.
Reproduction
Closed source code, but here are the relevant files (slightly modified)
// The file called findEnv.ts
import { env } from 'process';
export function findEnv(str: string, strict: boolean = true): string {
// Simplified code
if (str === 'prefix/app/1.0.0') {
return str
} else {
throw new Error(`Could not find env APP_VERSION`);
}
}
Output
[INFO 2:17:42 PM] [v1.0.7] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 2:17:43 PM] [API] Running Vitest v1.5.1 (my-frontend-app/vite.config.ts) with Node.js: /home/my-username/.nvm/versions/node/v20.14.0/bin/node
[INFO 2:17:43 PM] [API] Vitest v1.5.1 (my-frontend-app/vite.config.ts) process 1466673 created
[INFO 2:18:00 PM] [API] Collecting tests: src/api/utils/findEnv.test.ts
[Worker]
node:internal/event_target:1099
process.nextTick(() => { throw err; });
^
Error: Cannot find module '/home/my-username/repos/my-frontend-app/node_modules/tinypool/dist/esm/entry/worker.js'
at Function._resolveFilename (node:internal/modules/cjs/loader:1145:15)
at Function._load (node:internal/modules/cjs/loader:986:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at MessagePort.<anonymous> (node:internal/main/worker_thread:186:26)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:825:20)
at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28)
Emitted 'error' event on Tinypool instance at:
at EventEmitterReferencingAsyncResource.runInAsyncScope (node:async_hooks:206:9)
at Tinypool.emit (file:///home/my-username/repos/my-frontend-app/node_modules/tinypool/dist/esm/index.js:61:31)
at Worker.<anonymous> (file:///home/my-username/repos/my-frontend-app/node_modules/tinypool/dist/esm/index.js:752:30)
at Worker.emit (node:events:519:28)
at [kOnErrorMessage] (node:internal/worker:326:10)
at [kOnMessage] (node:internal/worker:337:37)
at MessagePort.<anonymous> (node:internal/worker:232:57)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:825:20)
at MessagePort.<anonymous> (node:internal/per_context/messageport:23:28) {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.14.0
Version
1.0.7
Validations
[X] Check that you are using the latest version of the extension
[X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Describe the bug
See the below Output and Reproduction.
Perhaps something weird; I have specified vitest version 2.0.5 in package.json and running with CLI works. Still the extension prints out vitest version 1.5.1.
Reproduction
Closed source code, but here are the relevant files (slightly modified)
Output
Version
1.0.7
Validations