feat: Windows support via Node polyfill layer#46
Open
antiresonant wants to merge 1 commit intogarrytan:mainfrom
Open
feat: Windows support via Node polyfill layer#46antiresonant wants to merge 1 commit intogarrytan:mainfrom
antiresonant wants to merge 1 commit intogarrytan:mainfrom
Conversation
Bun on Windows cannot launch Playwright browsers (both IPC pipe and WebSocket transports fail). This adds automatic Windows detection that runs the browse server via Node+tsx instead, with a polyfill layer for Bun-specific APIs (Bun.serve, Bun.write, Bun.file, Bun.spawn, etc.). Changes: - Add bun-polyfill-win.ts: Node-compatible Bun API polyfills - Add server-node.ts: Node entry point that loads polyfills + server - cli.ts: detect Windows paths, spawn server via tsx on win32 - server.ts: import.meta.dir fallback for Node compatibility - cookie-import-browser.ts: conditional bun:sqlite import - setup: cross-platform (auto-symlinks from any location, Defender guidance, Node prerequisite check on Windows) - package.json: add tsx dep, fix build script glob on Windows - WINDOWS.md: setup guide and architecture docs Tested end-to-end on Windows 11 with Bun 1.2.18 + Node 22. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
gstack is built for macOS, but Bun on Windows can't launch Playwright browsers — both IPC pipe and WebSocket transports fail. This PR adds automatic Windows detection so everything works out of the box.
Node + tsxinstead ofbun run, with a polyfill layer for Bun-specific APIs (Bun.serve,Bun.write,Bun.file,Bun.spawn, etc.)process.platform === 'win32'checks~/.claude/skills/), detects Windows, and provides Defender exclusion guidance if Chromium fails to launchWhat's changed
browse/src/bun-polyfill-win.tsbrowse/src/server-node.tsbrowse/src/cli.tsC:\prefix), spawns server vianpx tsxon Windowsbrowse/src/server.tsimport.meta.dirfallback toimport.meta.dirnamefor Nodebrowse/src/cookie-import-browser.tsbun:sqliteimport (graceful degradation)package.jsontsxdep, removedrm -f .*.bun-build(glob fails on Windows)setupWINDOWS.mdLimitation
cookie-import-browser(importing cookies from installed browsers viabun:sqlite) is unavailable on Windows.cookie-import <json-file>works fine.Test plan
bun run buildsucceeds on Windowsbun run dev goto https://example.com— navigates and returns 200bun run dev snapshot— returns accessibility treebrowse.exebinary works end-to-endconfig,cookie-import-browser,cookie-picker-routes,skill-validation)win32checks)Tested on Windows 11 Pro (10.0.26200), Bun 1.2.18, Node 22.17.0, Playwright 1.58.2.
🤖 Generated with Claude Code