vite-electron-builder icon indicating copy to clipboard operation
vite-electron-builder copied to clipboard

Multiple sourcemap sources

Open peterbud opened this issue 2 years ago • 2 comments

Describe the bug When running in development mode the sourcemaps are multiplied, resulting errors during debug

To Reproduce Steps to reproduce the behavior:

  1. npm run watch
  2. Click on DevTools/Sources
  3. See multiple referenced sources in the Source tree (screenshot below)
  4. Click on the "About" link
  5. 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 image

peterbud avatar Aug 18 '21 15:08 peterbud

Try inline all sourcemaps.

cawa-93 avatar Aug 18 '21 17:08 cawa-93

Even if I change the sourcemaps to inline I have the same picture.

peterbud avatar Aug 19 '21 08:08 peterbud

I'll close this for now

cawa-93 avatar Aug 27 '22 19:08 cawa-93

Also getting this issue: https://github.com/electron-vite/vite-plugin-electron/issues/70

Jazcash avatar Sep 02 '22 19:09 Jazcash

Will source maps loaded successfull if you open dev server in browser? I wondering: Is this electron issue or vire server issue?

cawa-93 avatar Sep 02 '22 19:09 cawa-93

Yeah 404 for them in browser too

Jazcash avatar Sep 02 '22 20:09 Jazcash

This may indicate that there is a problem with the Vite server configuration

cawa-93 avatar Sep 02 '22 22:09 cawa-93

It's definitely related to node integration because it's only when importing node-intended packages that the errors appear

Jazcash avatar Sep 02 '22 22:09 Jazcash

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

Jazcash avatar Sep 03 '22 00:09 Jazcash

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.

EmanueleCoppola avatar Sep 03 '22 19:09 EmanueleCoppola