- convert bun build paths to Windows-native via cygpath so the bundle
actually lands on disk when MSYS_NO_PATHCONV is set
- make Step 3 compat-header injection idempotent (no re-duplicate on rebuild)
- drop the duplicate createRequire import (reuse bundle's own) to fix
'Identifier createRequire has already been declared' on Node 25
Bun's bundler refused to inline socks and sharp (both ship
.node native addons), so the Windows node-server build
failed with 'Could not resolve: socks / sharp'.
Added --external socks and --external sharp to
browse/scripts/build-node-server.sh, matching the script's
own documented rule for .node-addon deps. Verified:
bash build-node-server.sh -> exit 0, emits server-node.mjs;
bun run build -> exit 0 (all 6 artifacts compile).
* fix(browse): externalize @ngrok/ngrok so Node server bundle builds on Windows
@ngrok/ngrok has a native .node addon that causes `bun build --outfile` to
fail with "cannot write multiple output files without an output directory".
Externalize it alongside the existing runtime deps (playwright, diff,
bun:sqlite), matching the exact pattern used for every other dynamic import
in server.ts.
Adds a policy comment explaining when to extend the externals list so the
next native dep doesn't repeat this failure.
Two community contributors independently converged on this fix:
- @tomasmontbrun-hash (#1019)
- @scarson (#1013)
Also fixes issues #1010 and #960.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(package.json): subshell cleanup so || true stops masking build/test failures
Shell operator precedence trap in both the build and test scripts:
cmd1 && cmd2 && ... && rm -f .*.bun-build || true
bun test ... && bun run slop:diff 2>/dev/null || true
The trailing `|| true` was intended to suppress cleanup errors, but it
applies to the entire `&&` chain — so ANY failure (including the
build-node-server.sh failure that broke Windows installs since v0.15.12)
silently exits 0. CI ran the build, the build failed, and CI reported green.
Wrap the cleanup/slop-diff commands in subshells so `|| true` only scopes to
the intended step:
... && (rm -f .*.bun-build || true)
bun test ... && (bun run slop:diff 2>/dev/null || true)
Verified: `bash -c 'false && echo A && rm -f X || true'` exits 0 (old,
broken), `bash -c 'false && echo A && (rm -f X || true)'` exits 1 (new,
correct).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* test(browse): add build validation test for server-node.mjs
Two assertions:
1. `node --check` passes on the built `server-node.mjs` (valid ES module
syntax). This catches regressions where the post-processing steps (perl
regex replacements) corrupt the bundle.
2. No inlined `@ngrok/ngrok` module identifiers (ngrok_napi, platform-
specific binding packages). Verifies the --external flag actually kept
it external.
Skips gracefully when `browse/dist/server-node.mjs` is missing — the dist
dir is gitignored, so a fresh clone + `bun test` without a prior build is
a valid state, not a failure.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(setup): verify @ngrok/ngrok can load on Windows
Mirror the existing Playwright verification step. Since @ngrok/ngrok is
now externalized in server-node.mjs (resolved at runtime from node_modules),
confirm the platform-specific native binary (@ngrok/ngrok-win32-x64-msvc et
al.) is installed at setup time rather than surfacing the failure later
when the user runs /pair-agent.
Same fallback pattern: if `node -e "require('@ngrok/ngrok')"` fails, fall
back to `npm install --no-save @ngrok/ngrok` to pull the missing binary.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* chore: bump to v0.18.0.1 for ngrok Windows fix + CI error-propagation
Fixes shipped in this version:
- Externalize @ngrok/ngrok so the Node server bundle builds on Windows
(PRs #1019, #1013; issues #1010, #960)
- Shell precedence fix so build/test failures no longer exit 0 in CI
- Build validation test for server-node.mjs
- Windows setup verifies @ngrok/ngrok native binary is loadable
Credit: @tomasmontbrun-hash (#1019), @scarson (#1013).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix: Windows support — Node.js server fallback for Playwright
Setup hangs on Windows 11 because Bun's child_process can't handle
Playwright's --remote-debugging-pipe (fd 3/4 pipe handles). Fall back
to Node.js on Windows for both the setup verification and server
runtime. macOS/Linux completely unaffected — all Windows code behind
IS_WINDOWS / process.platform === 'win32' guards.
Based on community PR #194 by @sozairali. Fixed sed -i portability
(perl -pi -e) in build-node-server.sh for macOS compatibility.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: cross-platform path handling for Windows compatibility
Replace hardcoded '/tmp' and 'dir + "/"' path checks with
platform-aware constants from new platform.ts module. On macOS/Linux
this evaluates identically ('/tmp', '/'); on Windows it uses
os.tmpdir() and path.sep. Zero behavior change on Unix.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* test: add tests for Windows polyfill, platform constants, and Node server resolution
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* docs: Windows support in README + CHANGELOG (v0.9.1.1)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* chore: bump version and changelog (v0.9.3.0)
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>