fix(cli): find the .exe shims when bun installed the project on Windows - #1411
Merged
Simon Ingeson (smonn) merged 1 commit intoJul 30, 2026
Conversation
bun install writes playwright.exe and appium.exe into node_modules/.bin, not the .cmd wrappers npm writes, so the CLI reported Playwright missing and Android flows failed on projects that had both installed. allPinnedResolved carried a second copy of the playwright name list. It now shares the platform-parameterized one, which also tightens POSIX to reject a lone .cmd. The platform is a required argument through every caller so one value decides both the resolved path and the spawn. Skipping playwright.bunx and appium.bunx: those are bun's metadata shims, not PE images, and buildSpawnCommand routes only .cmd and .bat through cmd.exe, so CreateProcess cannot run them. bun always writes the .exe beside them.
WalkthroughThe CLI now recognizes platform-specific Playwright and Appium shims, including Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant CLICommand
participant RuntimeEnvironment
participant ShimCandidates
participant FileSystem
CLICommand->>RuntimeEnvironment: resolve dependencies with process.platform
RuntimeEnvironment->>ShimCandidates: request Playwright/Appium candidates
ShimCandidates-->>RuntimeEnvironment: return platform-specific paths
RuntimeEnvironment->>FileSystem: check candidate existence
FileSystem-->>RuntimeEnvironment: return resolved runtime path
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Simon Ingeson (smonn)
marked this pull request as ready for review
July 30, 2026 20:05
Chase J (chajac)
approved these changes
Jul 30, 2026
Simon Ingeson (smonn)
deleted the
wiz-11281-windows-resolveplaywrightcli-fails-when-the-project
branch
July 30, 2026 20:25
This was referenced Jul 30, 2026
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.
Relates to WIZ-11281, WIZ-11286
Overview of Changes
bun installon Windows writesplaywright.exeandappium.exeintonode_modules/.bin, not the.cmdwrappers npm writes, so the CLI reported Playwright missing and Android flows failed on projects that had both installed. Awindows-latestprobe recorded on WIZ-11281 confirmed the shim names. Both candidate lists now include the.exe.allPinnedResolvedcarried a second copy of the Playwright name list, which is why a bun-installed project also reinstalled the runtime on every run. It now shares the platform-parameterized list, so the two cannot drift. That sharing also tightens POSIX to reject a lone.cmd, which is why this is onefixcommit and not the structural/behavioral split it started as — reusing the shared list is the behavior change, so no ordering makes the first commit behavior-preserving.resolveAppiumBinreturned a single path and could not express a candidate list, so it is gone and its three callers select viacheckExists, matching the Playwright shape.playwright.bunxandappium.bunxare deliberately skipped, against WIZ-11281's suggested fix: those are bun's metadata shims rather than PE images,buildSpawnCommandroutes only.cmd/.batthrough cmd.exe, and bun always writes the runnable.exebeside them. Both win32 lists still end in the extension-less shim; whether that entry is reachable on Windows is unproven and tracked in WIZ-11286, which requires a CI probe before anyone deletes it.Testing
Platform-parameterized unit tests cover both candidate lists and both consumers:
src/core/playwrightBins.test.ts,src/core/appiumBins.test.ts,src/domains/runtimeEnv/resolvePinned.test.ts(a win32 dir holding onlyplaywright.exenow resolves), andsrc/domains/doctor/checks/playwright.test.ts(doctor spawns the.exewhen bun wrote no.cmd). The win32 legs assert against injected platforms, so they run on any host.bun run typecheck bun run lint bun run format:check bun run knip bun run test bun run buildAll clean locally: 1224 tests pass, 0 fail.
Checklist