Open
Description
Describe the bug
When running vitest through the extension, it will fail to resolve paths like ~/utils
and other ones using ~
, which is an alias that's available in Nuxt.
Running vitest in the CLI has no issues with this.
Manually adding aliasses to tsconfig or vitest's config have no effect.
Reproduction
https://github.com/TheDutchCoder/vitest-extension-bug
Output
Part of the output with the errors.
[Error 8:13:12 PM] Error in /Users/reinierkaper/rvezy/rvezy-web-client/src/utils/rv/get-rv-snapshot.vitest.spec.ts Error: Failed to load url ~/constants (resolved id: ~/constants) in /Users/reinierkaper/rvezy/rvezy-web-client/src/utils/rv/get-rv-details.ts. Does the file exist?
at loadAndTransform (file:///Users/reinierkaper/rvezy/rvezy-web-client/node_modules/vite/dist/node/chunks/dep-CB_7IfJ-.js:51920:17)
at async ViteNodeServer._transformRequest (file:///Users/reinierkaper/rvezy/rvezy-web-client/node_modules/vite-node/dist/server.mjs:542:16)
at async ViteNodeServer._fetchModule (file:///Users/reinierkaper/rvezy/rvezy-web-client/node_modules/vite-node/dist/server.mjs:504:17)
at async Proxy.fetch (file:///Users/reinierkaper/rvezy/rvezy-web-client/node_modules/vitest/dist/chunks/resolveConfig.RxKrDli4.js:6616:22)
at async EventEmitter.onMessage (file:///Users/reinierkaper/rvezy/rvezy-web-client/node_modules/vitest/dist/chunks/index.68735LiX.js:91:20)
Extension Version
1.8.4
Vitest Version
2.1.8
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.
Activity