-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Closed
Description
Describe the bug
After updating to vitest/vite-node 0.31.2, I can't run my tests anymore. Instead, I get this error:
Error [ERR_MODULE_NOT_FOUND]: Cannot find package '__sveltekit' imported from /Users/daniel/dev/node/example/node_modules/@sveltejs/kit/src/runtime/app/environment.js
at new NodeError (node:internal/errors:399:5)
at packageResolve (node:internal/modules/esm/resolve:889:9)
at moduleResolve (node:internal/modules/esm/resolve:938:20)
at defaultResolve (node:internal/modules/esm/resolve:1153:11)
at nextResolve (node:internal/modules/esm/loader:163:28)
at ESMLoader.resolve (node:internal/modules/esm/loader:838:30)
at ESMLoader.getModuleJob (node:internal/modules/esm/loader:424:18)
at ModuleWrap.<anonymous> (node:internal/modules/esm/module_job:77:40)
at link (node:internal/modules/esm/module_job:76:36) {
code: 'ERR_MODULE_NOT_FOUND'
}
I'm not sure if it's related, but there has been a similar looking issue in the past: sveltejs/kit#9162
Reproduction
- Run
npm run test:runto see the error
To make the tests run:
- Downgrade the vitest version in the package.json to
0.30.1 - Run
npm i - Run the tests with
npm run test:run, they should pass
System Info
System:
OS: macOS 13.3.1
CPU: (10) arm64 Apple M1 Max
Memory: 9.13 GB / 64.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 18.16.0 - ~/.asdf/installs/nodejs/18.16.0/bin/node
Yarn: 1.22.19 - ~/.asdf/installs/nodejs/18.16.0/bin/yarn
npm: 9.5.1 - ~/.asdf/plugins/nodejs/shims/npm
Browsers:
Chrome: 114.0.5735.90
Edge: 113.0.1774.57
Firefox: 103.0.2
Firefox Developer Edition: 113.0
Safari: 16.4
Safari Technology Preview: 16.4
npmPackages:
@sveltejs/kit: ^1.20.0 => 1.20.0
@vitest/coverage-c8: ^0.31.2 => 0.31.3
vite: ^4.3.9 => 4.3.9
vitest: ^0.31.2 => 0.31.3Used 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
No labels