Commit Graph

1 Commits

Author SHA1 Message Date
Jayesh Betala 812a825241 fix(setup): pin Playwright browser install to the bundled version (#1829)
Headed `browse connect` fails with a missing full Chromium build (e.g.
`chromium-1208/.../Google Chrome for Testing`) after a "successful" ./setup,
while headless browse works fine. Two root causes in setup:

1. The browse binary is compiled against the lockfile-pinned Playwright
   (1.58.2 -> Chromium 1208), but `bunx playwright install chromium` resolves
   the *latest* Playwright at runtime (1.60.0 -> Chromium 1223) and downloads a
   different full build than the binary expects.
2. `ensure_playwright_browser()` only does a headless `chromium.launch()`, which
   passes off the cached headless shell even when the full Chrome-for-Testing
   build that headed mode needs is missing — so the mismatch is never caught.

Fix: install browsers with the Playwright version bundled in node_modules (so
install and runtime can never drift), and assert `chromium.executablePath()`
exists before treating the browser as ready so a missing full build fails setup
instead of being masked.

Adds test/setup-playwright-pin.test.ts (static source assertions, no browser
download) guarding both invariants.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-02 11:52:29 +05:30