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

Source map support to trace production errors under the bytecode plugin

Open gauravbordoloi opened this issue 1 year ago • 2 comments

Describe the bug

I am using Sentry for error monitoring and I want to get a proper stacktrace to fix production issues. With bytenode enabled, I am unable to generate source maps.

Sentry throws the below exception (vite:bytecode plugin) Sourcemap is likely to be incorrect: a plugin (vite:bytecode) was used to transform files, but didn't generate a sourcemap for the transformation. Consult the plugin documentation for help

Any solution to generate source map? Or this is never possible?

Electron-Vite Version

1.0.25

Electron Version

25.3.1

Vite Version

4.4.5

Validations

gauravbordoloi avatar Jul 21 '23 07:07 gauravbordoloi

You can set build.sourcemap to true to generate production source maps.

export default defineConfig({
  main: {
    build: {
      sourcemap: true
    }
  }
  // ...
}

But with the bytecode plugin enabled, there are issues that need to be resolved. Might not be able to make it work.

alex8088 avatar Jul 22 '23 05:07 alex8088