-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Describe the bug
After upgrading from v3 to v4, we started seeing sourcemap warnings when running tests.
These warnings come from libraries in node_modules, and as far as I can see, point to existing sourcemap files on disk, such as this:
Sourcemap for "/Users/fotis/oss/vitest-optimizer-sourcemap/node_modules/.pnpm/domutils@3.2.2/node_modules/domutils/lib/esm/feeds.js" points to missing source filesI have narrowed this down to the use of deps.optimizer.ssr.enabled, but these warnings are emitted even for packages unrelated to those being optimized. I am including more info in the reproduction step below 😌
(I vaguely remember seeing these warnings in past Vitest versions, but they had gone away for a while 💭 )
Reproduction
I have a reproduction at https://github.com/fpapado/vitest-optimizer-ssr-sourcemap-warning, simply:
nvm use
corepack enable
pnpm install
pnpm testand expect to see warnings about sourcemaps pointing to missing files.
Some additional info:
- Using vitest v3 (
pnpm add -DE vitest@3) shows no such warnings - In v4, if
deps.optimize.ssr.enabledistrue, butincludeis empty or not defined, then there are no warnings - In v4, it does not matter whether the optimizer is enabled for the specific files that are logged; many seemingly unrelated packages will emit these warnings
Please let me know if there is any other info that I can provide, and I'll get back to you!
System Info
System:
OS: macOS 15.6.1
CPU: (10) arm64 Apple M1 Pro
Memory: 3.05 GB / 32.00 GB
Shell: 5.9 - /bin/zsh
Binaries:
Node: 24.11.0 - /Users/fotis/.local/state/fnm_multishells/16092_1762799422618/bin/node
npm: 11.6.1 - /Users/fotis/.local/state/fnm_multishells/16092_1762799422618/bin/npm
pnpm: 10.15.0 - /Users/fotis/.local/state/fnm_multishells/16092_1762799422618/bin/pnpm
Browsers:
Chrome: 142.0.7444.60
Chrome Canary: 144.0.7520.0
Firefox: 144.0.2
Firefox Developer Edition: 145.0
Safari: 26.0.1
Safari Technology Preview: 26.0
npmPackages:
vite: 7.2.2 => 7.2.2
vitest: 4.0.8 => 4.0.8Used Package Manager
pnpm
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.