vite-electron-builder
vite-electron-builder copied to clipboard
Multiple sourcemap sources
Describe the bug When running in development mode the sourcemaps are multiplied, resulting errors during debug
To Reproduce Steps to reproduce the behavior:
-
npm run watch
- Click on DevTools/Sources
- See multiple referenced sources in the Source tree (screenshot below)
- Click on the "About" link
- In the terminal you see the following error:
5:01:31 PM [main] [20564:0818/170131.504:ERROR:CONSOLE(1)] "Could not load content for http://localhost:3000/src/components/C:/B/packages/renderer/src/components/About.vue (HTTP error: status code 404, net::ERR_HTTP_RESPONSE_CODE_FAILURE)", source: devtools://devtools/bundled/core/sdk/sdk.js (1)
Please note the weird concatenated link.
I'm using Windows 10 and VS Code attaching debugger to the renderer process
It is also causing problems when I try to debug the renderer process, and the breakpoints are being hit, but the lines are off.
I'm not sure whether this is a vite issue or a local config problem, I have a hunch it might be related to the way how alias resolve is working, but I might be totally wrong
Expected behavior Have all sources appear once in a source tree
Screenshots
Try inline all sourcemaps.
Even if I change the sourcemaps to inline I have the same picture.
I'll close this for now
Also getting this issue: https://github.com/electron-vite/vite-plugin-electron/issues/70
Will source maps loaded successfull if you open dev server in browser? I wondering: Is this electron issue or vire server issue?
Yeah 404 for them in browser too
This may indicate that there is a problem with the Vite server configuration
It's definitely related to node integration because it's only when importing node-intended packages that the errors appear
It seems installing https://github.com/vite-plugin/vite-plugin-esmodule and adding those modules to it fixed the majority of the warnings for me
It seems installing https://github.com/vite-plugin/vite-plugin-esmodule and adding those modules to it fixed the majority of the warnings for me
Definitely not a permanent solution since I have one module in particular (node-opcua) that can't be built as esmodule because of some external file imports.