-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Copy link
Labels
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)
Description
Describe the bug
After updating to vitest 4.0.3, I can't run my tests anymore. Instead, I get this error:
Error: Cannot find package '__sveltekit' imported from /home/projects/vitest-dev-vitest-u8f2u2kl/node_modules/@sveltejs/kit/src/runtime/app/environment/index.js
This happens when I try to import any special SvelteKit module that's prefixed with $, like $app/environment.
There have been similar issues in the past, like #3483 and #4067.
Reproduction
StackBlitz: https://stackblitz.com/edit/vitest-dev-vitest-u8f2u2kl?file=src%2Fdoes-not-work.svelte.js
Run npm test. The default output is very cut off in StackBlitz, that's why I configured it to use the tap reporter instead.
System Info
System:
OS: Linux 5.0 undefined
CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
Memory: 0 Bytes / 0 Bytes
Shell: 1.0 - /bin/jsh
Binaries:
Node: 20.19.1 - /usr/local/bin/node
Yarn: 1.22.19 - /usr/local/bin/yarn
npm: 10.8.2 - /usr/local/bin/npm
pnpm: 8.15.6 - /usr/local/bin/pnpm
npmPackages:
@vitest/ui: latest => 4.0.3
vite: latest => 7.1.12
vitest: latest => 4.0.3
(These are the values from StackBlitz)Used Package Manager
npm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- 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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
p4-importantViolate documented behavior or significantly improves performance (priority)Violate documented behavior or significantly improves performance (priority)