-
Notifications
You must be signed in to change notification settings - Fork 120
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
contentScript sourceMap does not work #236
Comments
Thanks for reporting. As far as I know, this is a problem with Chrome, not WXT. I have another build tool,
It works in Firefox, and this can be reproduced with any other bundler or project setup. |
If anyone can make this work with a basic setup or different build tool, I would gladly implement the fix in WXT, because this is very annoying. |
@aklinker1 I'm not sure that it actually is an issue with chrome as I get proper line numbers and mapping with this plasmo example : https://github.com/PlasmoHQ/examples/tree/main/with-content-scripts-ui Edit: It seems it's not without bugs either. See PlasmoHQ/plasmo#856 (comment) |
Starting vite with export default defineConfig({
vite: () => ({
plugins: [react()],
mode: "development",
build: {
minify: false,
sourcemap: "inline",
terserOptions: {
sourceMap: true,
compress: false,
},
rollupOptions: {
treeshake: false,
}
}
}),
}); I get the following error message WXT 0.14.7 23:55:32
√ Started dev server @ http://localhost:3000 23:55:32
i Pre-rendering chrome-mv3 for development with Vite 5.0.12 23:55:32
(wxt:unimport plugin) Sourcemap is likely to be incorrect: a plugin (wxt:unimport) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
(wxt:unimport plugin) Sourcemap is likely to be incorrect: a plugin (wxt:unimport) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help
√ Built extension in 592 ms |
Mapping also works in CRXJS which also uses vite plugins I'm looking forward to the progress on wxt. It's nice to have good options for chrome extension development :) |
@lionelhorn After making the change in #381, I was able to get source maps working, but I needed to uncheck the "content scripts injected by extension" checkbox under the ignore list in devtools. source-maps.mp4Unfortunately, it resets when running I have a PR open for |
Looks like it's a setting called |
Released some new changes to improve content script sourcemaps in |
There are lots of command line flags in chromium I'm not using the runner so your PR fixed the issue for me 👍 Thanks for the quick fix ! |
Yeah, I wasn't able to find it in the CLI flags. Edit: Found it! I should be able to enable it automatically once my web-ext PR gets merged, or I add the change into my fork, |
Describe the bug
contentScript sourceMap does not work
Expected behavior
It can be used at the tsx source file breakpoint
Screenshots
Environment
The text was updated successfully, but these errors were encountered: