Skip to content

fix(desktop): bootstrap Electron before dev startup - #1146

Merged
vastsa merged 2 commits into
vastsa:mainfrom
aaskfuqw:fix/electron-dev-bootstrap
Sep 28, 2026
Merged

vastsa merged 2 commits into
vastsa:mainfrom
aaskfuqw:fix/electron-dev-bootstrap

Conversation

@aaskfuqw

Copy link
Copy Markdown

Fixes #1144.

Electron 43 downloads its platform binary when the electron package is
resolved. electron-vite expects the resulting path.txt marker, while the
development launcher previously resolved Electron only on macOS. A first
pnpm dev on Linux or Windows therefore stopped after the Vite builds with
Error: Electron uninstall.

Resolve Electron before platform-specific launcher setup. macOS continues to
use that resolved executable when it creates its branded development host. A
source-contract regression test locks the ordering.

Validation:

  • node --test apps/desktop/test/development-branding.test.mjs (9 passed; 1 macOS-only test skipped)
  • pnpm --filter @pi-desktop/desktop build
  • pnpm check:pr-base
  • pnpm dev with an isolated PI_DESKTOP_DATA_DIR: Electron, host-core,
    agent sidecar, and bundled plugins started successfully. The command was
    intentionally terminated after 35 seconds.

pnpm test:e2e:boot was run twice after the final commit and failed its
existing 800-session list latency threshold. Both runs completed the Electron
boot, preload/IPC, host-core and project-remove checks; only later list reads
exceeded 1s (about 1.2-2.0s). This suite launches the built application,
not scripts/dev-electron.mjs, and the failure is unrelated to the changed
development-launch ordering.

aaskfuqw and others added 2 commits September 27, 2026 22:37
Electron 43 installs its platform binary when the package is resolved, but electron-vite reads the installation marker before doing so. This made first-time development launches fail outside macOS.

Resolve Electron before the platform-specific launcher setup and retain the startup ordering with a regression test.

Closes vastsa#1144
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 this pull request may close these issues.

[Bug] 首次 pnpm dev 因 Electron 二进制未就绪而失败

2 participants