Repository navigation
fix(dev): spawn the running Bun so npm-installed Bun works on Windows - #4525
oseunabel62-tech wants to merge 4 commits into
Conversation
`spawn` runs no shell, so a bare "bun" only resolves bun.exe. An npm-installed Bun puts only bun.cmd/bun.ps1 shims on Windows PATH, and `bun run dev` failed in predev with "spawnSync bun ENOENT". Resolve the executable through a shared bunCommand() helper: the Bun running the script, else the bun binary `bun run` exports as npm_execpath, else "bun". Use it for every Bun spawn in scripts (prepare-dev, electron smoke test, renderer perf baseline), explain a missing Bun instead of a raw ENOENT, and fail CI on any new bare bun/bunx spawn.
|
Thank you for contributing to VoiceStudio. Before this pull request can merge, everyone who contributed to it must sign the Contributor License Agreement 1.0 once. You keep your copyright; the agreement lets Yupcha Softwares Private Limited, the company that maintains VoiceStudio, ship your work in both the AGPL-3.0 app and commercial builds. Still to sign: @oseunabel62-tech, @oluwaseun244311 To sign, post this as a new comment on its own line: Comment CI and automated reviews wait for your signature. Signing takes a minute; once you sign, CI starts automatically and this pull request is marked ready for review. Until then it stays a draft. Using an AI coding agent? Give it this |
|
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
CLA deadline: 2026-12-02 UTC (2 days remaining). Signing takes a minute: follow the instructions in the CLA check above. After the deadline, maintainers may independently fix the underlying issue without using your contribution. You can still sign after the deadline; this timer does not close your pull request. |
|
@oseunabel62-tech, @oluwaseun244311 — a reminder that the CLA deadline is 2026-12-02 UTC. Please see the CLA instructions above. |
Problem
On Windows with Bun installed through npm (
npm i -g bun),bun run devfails before the app starts:spawnruns no shell, so a bare"bun"only resolvesbun.exe. npm puts onlybun.cmd/bun.ps1shims on PATH.Fix
electron/scripts/bun-command.mjs→bunCommand(): the Bun running the script (process.execPathunder Bun), else the Bun binarybun runexports asnpm_execpath, else"bun".scripts/prepare-dev.mjs,scripts/electron-smoke-test.mjs,scripts/perf/renderer-baseline.mjs(bunx→bun x).ENOENT.scripts/orelectron/scripts/spawns a barebun/bunx.macOS/Linux behavior is unchanged (
npm_execpathis the same Bun that a barebunresolves to there).Tests
tests/frontend/bunCommand.test.mjs: 6 tests. 3 fail before the fix and pass after.node --test tests/frontend/bunCommand.test.mjs tests/frontend/setupApi.test.mjs electron/tests/node-version.test.mjs: 39 pass, 0 fail.bun run predevfails before the fix and passes after.