Skip to content

v4: all packages are inlined with deps.optimizer ("Sourcemap for ... points to missing files", when using deps.optimizer.{mode}.enabled and include) #8995

@fpapado

Description

@fpapado

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 files

I 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 test

and 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.enabled is true, but include is 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.8

Used Package Manager

pnpm

Validations

Metadata

Metadata

Assignees

Labels

p3-minor-bugAn edge case that only affects very specific usage (priority)

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions