fix: prebundle deps before loading electron app #254
Reference in New Issue
Block a user
Delete Branch "fix-unoptimized-deps-error"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Electron Forge restarts the renderer process without fully restarting the Vite dev server, so the browser gets a fresh page with a new hash but the Vite server still has the old pre-bundle cache — mismatch causes the 504 outdated error every other time we launch.
Closes #185
Summary by CodeRabbit
📝 Walkthrough
Walkthrough
The
startnpm script in the desktop package is updated to run Vite dependency optimization before launching Electron Forge. This adds a preprocessing step that optimizes dependencies according tovite.main.config.tsconfiguration.Changes
Desktop development startup flow
js/desktop/package.jsonstartscript now executescross-env vite optimize -c vite.main.config.tsbeforeelectron-forge start, adding dependency optimization as a pre-launch step.Estimated code review effort
🎯 1 (Trivial) | ⏱️ ~3 minutes
Poem
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
#185by running vite optimize before electron-forge start, ensuring pre-bundle consistency and preventing the white screen error.#185.✏️ Tip: You can configure your own custom pre-merge checks in the settings.
✨ Finishing Touches
🧪 Generate unit tests (beta)
fix-unoptimized-deps-errorComment
@coderabbitai helpto get the list of available commands and usage tips.🧹 Nitpick comments (2)
🤖 Prompt for all review comments with AI agents
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID:
13bb0a3e-85b0-4f59-b1b7-a6747b1ffd33📥 Commits
Reviewing files that changed from the base of the PR and between
946d141897andcf9c272df7.📒 Files selected for processing (1)
js/desktop/package.json