I reported the issue to esbuild https://github.com/evanw/esbuild/issues/3945, but Vite side workaround seems reasonably simple, so I made a PR here. Note that Rolldown doesn't create a source map for this case, so this won't be an issue with rolldown-based optimizer in the future.
How to verify
pnpm -C playground/optimize-deps dev --force
open a page on Firefox (I tested on 132.0)
open devtool debugger tab
on main, it shows "Source map error: No sources are declared in this source map." in devtool console
on this PR, there's no warning.
(there were already a warning from an existing test dependencies, but I added a probably simplest one to see it easily)
Description
I reported the issue to esbuild https://github.com/evanw/esbuild/issues/3945, but Vite side workaround seems reasonably simple, so I made a PR here. Note that Rolldown doesn't create a source map for this case, so this won't be an issue with rolldown-based optimizer in the future.
How to verify
pnpm -C playground/optimize-deps dev --force
(there were already a warning from an existing test dependencies, but I added a probably simplest one to see it easily)