What
bun run dev:desktop fails on Windows with a PlatformError: NotFound when spawning bun tsdown. The build step in apps/server/scripts/cli.ts never completes, so the desktop app cannot start.
Error
PlatformError: NotFound: ChildProcess.spawn (bun tsdown)
Why
On Windows, bun is installed as bun.cmd (a shell wrapper). Node's child_process.spawn cannot resolve .cmd extensions without shell: true. The current code at cli.ts:131 calls ChildProcess.make without setting shell, so spawn looks for a literal bun executable and fails.
This happens when:
- The user installs Bun from a different source than the default (e.g., via
npm i -g bun, Scoop, or a standalone installer that creates .cmd shims)
- There is no Turborepo cache hit for the
tsdown build step (e.g., a fresh clone, cleared cache, or a git worktree)
When Turbo has a cached build, the bun tsdown spawn is skipped entirely, which masks the bug.
Fix
Add shell: true on Windows to ChildProcess.make at cli.ts:131:
yield* runCommand(
ChildProcess.make({
cwd: serverDir,
stdout: config.verbose ? "inherit" : "ignore",
stderr: "inherit",
shell: process.platform === "win32",
})`bun tsdown`,
);
The same pattern may apply to the npm call at cli.ts:224, since npm is also a .cmd shim on Windows.
Steps to Reproduce
- Install Bun on Windows (via npm, Scoop, or standalone installer)
- Clone the repo
- Run
bun install
- Clear Turbo cache or use a fresh worktree (so no cached build exists)
- Run
bun run dev:desktop
- Observe the
PlatformError: NotFound crash
Environment
- Windows 11 Pro (10.0.22631)
- Bun 1.x (installed via standalone installer, creates
.cmd shims)
- Node.js (
.cmd shim behavior is standard on Windows)
What
bun run dev:desktopfails on Windows with aPlatformError: NotFoundwhen spawningbun tsdown. The build step inapps/server/scripts/cli.tsnever completes, so the desktop app cannot start.Error
Why
On Windows,
bunis installed asbun.cmd(a shell wrapper). Node'schild_process.spawncannot resolve.cmdextensions withoutshell: true. The current code atcli.ts:131callsChildProcess.makewithout settingshell, sospawnlooks for a literalbunexecutable and fails.This happens when:
npm i -g bun, Scoop, or a standalone installer that creates.cmdshims)tsdownbuild step (e.g., a fresh clone, cleared cache, or a git worktree)When Turbo has a cached build, the
bun tsdownspawn is skipped entirely, which masks the bug.Fix
Add
shell: trueon Windows toChildProcess.makeatcli.ts:131:The same pattern may apply to the
npmcall atcli.ts:224, sincenpmis also a.cmdshim on Windows.Steps to Reproduce
bun installbun run dev:desktopPlatformError: NotFoundcrashEnvironment
.cmdshims).cmdshim behavior is standard on Windows)