You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
support top-level await in the main process when using the vite plugin #3943
I agree to follow the code of conduct that this project uses.
I have searched the issue tracker for a feature request that matches the one I want to file, without success.
Problem description
When I run my electron app that has some top-level await code and is bundled using the vite plugin, I get the following message in my console:
✓ 493 modules transformed.
Module format "cjs" does not support top-level await. Use the "es" or "system" output formats rather.
file: /home/hab25/my/work/react-electron-poc/src/main.ts
Proposed solution
Implementing this probably means implementing the following TODO:
Hey @hab25, thanks for the report. As you mentioned in the issue, this is currently blocked on us upgrading our build system to type: module and upgrading to Vite 6. There's a bit of a chicken-and-egg issue right now with making breaking changes for Electron Forge 8 so there's some pending work that needs to be done beforehand. 🙇
Activity
erickzhao commentedon May 21, 2025
Hey @hab25, thanks for the report. As you mentioned in the issue, this is currently blocked on us upgrading our build system to
type: moduleand upgrading to Vite 6. There's a bit of a chicken-and-egg issue right now with making breaking changes for Electron Forge 8 so there's some pending work that needs to be done beforehand. 🙇