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)