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

Sourcemaps don't seem to be loaded while Debugging main process with Chrome Dev Tools #3483

Closed
3 tasks done
gaurav21r opened this issue Feb 1, 2024 · 4 comments · May be fixed by #3575
Closed
3 tasks done

Sourcemaps don't seem to be loaded while Debugging main process with Chrome Dev Tools #3483

gaurav21r opened this issue Feb 1, 2024 · 4 comments · May be fixed by #3575

Comments

@gaurav21r
Copy link

gaurav21r commented Feb 1, 2024

Pre-flight checklist

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project uses.
  • I have searched the issue tracker for a bug that matches the one I want to file, without success.

Expected behavior

I should be able to debug the main process with Chrome Dev Tools with proper source maps instead I am getting this:

image

Extremely simple to reproduce.

Just scaffold a new project with the Vite + Typescript plugin

npm init electron-app@latest pure-forge-app -- --template=vite-typescript                           

Then add a new entry to scripts in package.json.
"dev:main": "electron-forge start -- --inspect-brk"

As suggested here, https://www.electronforge.io/cli#options

Electron Forge version

7.2.0

Electron version

v28.2.1

Operating system

macOS 14.2.1

Last known working Electron Forge version

7.2.0

@caoxiemeihao
Copy link
Member

vite.main.config.mjs

defineConfig({
  build: {
+   rollupOptions: {
+     output: {
+       sourcemap: true,
+     },
+   },
  },
});

@gaurav21r
Copy link
Author

@caoxiemeihao Thanks a ton! Shouldn't this be default behaviour for DEVELOPMENT and probably optional for PRODUCTION?

@caoxiemeihao
Copy link
Member

@caoxiemeihao Thanks a ton! Shouldn't this be default behaviour for DEVELOPMENT and probably optional for PRODUCTION?

This is a good idea, and I will improve the sourcemap option in future versions.

@gaurav21r
Copy link
Author

@caoxiemeihao Incase you can give me some quick directions, I'd love to attempt a PR myself?

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

Successfully merging a pull request may close this issue.

2 participants