You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Vite chokes outputting sourcemaps for modules with query parameters when there are certain kinds of plugins outputting sourcemaps from transform
#11860
Closed
7 tasks done
segevfiner opened this issue
Jan 31, 2023
· 2 comments
Using @rollup/plugin-replace with a web worker imported using ?worker causes sourcemaps to break.
Note that transform callbacks are allowed to return source maps with sources & sourcesContent not set correctly, e.g. [null], & rollup is supposed to correct the other fields, only really looking at mappings, names AFAIK.
The sourcemaps for worker.ts and test.js are borked. Pointing to null as the source file, Vite also spews Sourcemap for "/Users/segevfiner/junk/vite-worker-sourcemaps-bug/src/worker.ts" points to missing source files.
Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
Make sure this is a Vite issue and not a framework-specific issue. For example, if it's a Vue SFC related bug, it should likely be reported to vuejs/core instead.
Describe the bug
Using
@rollup/plugin-replace
with a web worker imported using?worker
causes sourcemaps to break.Note that transform callbacks are allowed to return source maps with
sources
&sourcesContent
not set correctly, e.g.[null]
, & rollup is supposed to correct the other fields, only really looking at mappings, names AFAIK.See https://rollupjs.org/plugin-development/#source-code-transformations
Originally reported here, but pinpointed to Vite:
cc @YossiSaadi
Reproduction
https://github.com/segevfiner/vite-worker-sourcemaps-bug
Steps to reproduce
pnpm install
&pnpm dev
.worker.ts
andtest.js
are borked. Pointing tonull
as the source file, Vite also spewsSourcemap for "/Users/segevfiner/junk/vite-worker-sourcemaps-bug/src/worker.ts" points to missing source files
.System Info
Used Package Manager
pnpm
Logs
Click to expand!
Validations
The text was updated successfully, but these errors were encountered: