Repository navigation
fix(desktop): install the Electron binary before dev - #174
Merged
Merged
Conversation
Electron 42 dropped the postinstall hook that downloaded the platform binary and exposes it as an `install-electron` bin the consumer has to call, so `bun install` left `node_modules/electron` without a `dist/` and `bun dev:desktop` died with `Error: Electron uninstall` before the app could launch. `predev` now runs the installer; it short-circuits once the binary matches package.json, so repeat runs are free. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
quickbeard
force-pushed
the
desktop-electron-install
branch
from
August 12, 2026 08:00
1371573 to
0a7e51d
Compare
The predev hook now installs the binary automatically, so the failure the section documented no longer reaches a fresh clone. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
bun dev:desktopwas dead on a fresh clone:Electron 42 removed the
postinstallhook that downloaded the platform binary and exposes it as aninstall-electronbin the consumer must call — electron 41's published manifest still has"postinstall": "node install.js", 42.3.3's has noscriptsfield at all. Sobun installleavespackages/desktop/node_modules/electronwith nodist/and nopath.txt, andelectron-vite devaborts ingetElectronPathbefore it can spawn anything.packages/desktop/scripts/predev.tsnow runsbun run install-electronahead of the icon copy and the node-sidecar build.Why
predevand not the rootpostinstallOnly someone actually launching the desktop app should pay the ~100 MB download (cached in
~/.cache/electron), andinstall.jsshort-circuits whendist/version+path.txtalready matchpackage.json— measured 47 ms on a warm tree, so repeatbun dev:desktopruns cost nothing.Not added to
prebuild/package:electron-vite buildnever spawns Electron, andelectron-builderfetches its own copy through@electron/get.Also
bun dev:desktopfails with 'Error: Electron uninstall'" subsection under Development explaining the cause, the standalonebun --cwd packages/desktop run install-electroncommand, and how to recover from a partial download.bun dev:desktopadded to the command list.packages/desktop/scripts/predev.ts(upstream file), with the on-conflict guidance to drop the line if upstream adds its own install step or pins Electron back below 42.No CHANGELOG entry: this is dev-environment setup, not user-facing product behavior.
Test plan
bun --cwd packages/desktop run install-electrondownloadsdist/+ writespath.txt(electron 42.3.3, linux x64), and re-running exits 0 in 47 ms.bun dev:desktopon this branch runs predev → vite → launches the Electron window and reaches "server ready"; previously it exited 1 atgetElectronPath.npx prettier --check README.mdpasses.🤖 Generated with Claude Code