-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed as not planned
Labels
Description
Describe the bug
Vite lazily initializes the SSR deps optimizer when ViteDevServer.ssrLoadModule is called for the first time.
Vitest/vite-node does not seem to ever call this method, so the optimizer never ends up being initialized into the devSsrDepsOptimizerMap, which Vite uses to resolve the appropriate optimizer.
Reproduction
I'm currently running Vitest 0.34 with Vite 4, but I was able to recreate the issue with the latest Vitest and Vite 5:
https://stackblitz.com/edit/vitest-dev-vitest-1flfpv?file=test%2Fweb.test.ts
System Info
System:
OS: macOS 13.6.3
CPU: (10) arm64 Apple M1 Pro
Memory: 103.50 MB / 16.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.10.0 - /opt/homebrew/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 10.2.3 - /opt/homebrew/bin/npm
pnpm: 7.9.5 - /opt/homebrew/bin/pnpm
Browsers:
Chrome: 120.0.6099.199
Edge: 120.0.2210.121
Safari: 17.2.1
npmPackages:
@vitest/coverage-v8: ^0.34.6 => 0.34.6
vitest: ^0.34.6 => 0.34.6Used 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.