Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breaks when module ID includes query parameters #238

Closed
segevfiner opened this issue Jan 30, 2023 · 1 comment
Closed

Breaks when module ID includes query parameters #238

segevfiner opened this issue Jan 30, 2023 · 1 comment

Comments

@segevfiner
Copy link

segevfiner commented Jan 30, 2023

Try https://github.com/segevfiner/vite-worker-sourcemaps-bug, the source map for worker.ts?worker is null which means source stepping doesn't work. The source map for test.js is bugged completely and in addition has null in the sources, which is not allowed, and causes the browser to try to present the file null as the source. This is encountered in Vite via using magic-string inside @rollup/plugin-replace for a dynamic replacement (Which is why it doesn't use Vite builtin define). Likely caused by the query parameter used for workers, and the dynamic ?t=${timestamp} cache busting query parameter added by Vite.

There are often also warning of the form:

Sourcemap for "/Users/segevfiner/junk/vite-worker-sourcemaps-bug/src/worker.ts" points to missing source files

cc @YossiSaadi

@segevfiner
Copy link
Author

I tried to debug this further and it seems it might be an issue in Vite own sourcemaps plugin that doesn't handle it's own ids with query parameters when there are plugins that output some kinds of sourcemaps. I'll reopen there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant