You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
browse: build-node-server.sh fails on Windows when ngrok produces multiple output files #960
scripts/build-node-server.sh fails on Windows with:
error: cannot write multiple output files without an output directory
This means server-node.mjs is never generated, and the browse binary crashes at startup:
error: server-node.mjs not found. Run `bun run build` to generate the Windows server bundle.
Root Cause
The build script uses bun build --outfile dist/server-node.mjs, which writes a single file. On Windows, the ngrok native addon (ngrok.win32-x64-msvc.node, ~10MB) is emitted as a separate asset. Bun refuses to write multiple outputs to a single --outfile.
+1 / extra data point: this isn't Windows-specific — the same bun build invocation fails on Linux too.
Repro on Linux x86_64:
OS: Linux 6.17.0-20-generic
Bun: 1.3.12
gstack: v0.16.3.0 (c6e6a21)
Command: the exact one from browse/scripts/build-node-server.sh:17-23
Output:
Building Node-compatible server bundle...
error: cannot write multiple output files without an output directory
On Linux, ngrok emits ngrok.linux-x64-gnu.node (same ~10 MB native addon, different triple), and bun build --outfile rejects the multi-output emission the same way. The failure is just hidden on Linux/macOS because browse/src/cli.ts:80-83 only hard-fails on server-node.mjs missing when process.platform === 'win32' — non-Windows users keep running against whatever stale server-node.mjs is left in dist/.
Side effect worth flagging: ./setup logs the error but exits 0 (the build script fails the bun build step but the rest of setup is in a separate shell context, so setup reports "gstack ready" despite the broken bundle). Easy to miss in install output.
The proposed fix (--outdir + --entry-naming) should solve both platforms at once — confirmed the --outfile path is the sole failure point in my repro. Happy to test a PR on Linux if useful.
Also hitting this on macOS 15.7.4 (Sequoia) x86_64 with bun 1.3.11 on gstack v0.16.3.0 (commit c6e6a21). So the "multiple output files" error is confirmed on Windows 11, Linux x86_64, and macOS Intel — fully cross-platform at this point regardless of ngrok.
Surfaced mid-./setup during a routine 0.16.2.0 → 0.16.3.0 upgrade via /gstack-upgrade:
Even on macOS where server-node.mjs isn't strictly needed (bun drives Playwright directly), the failure has a silent side effect. The bun run build chain in package.json:11 breaks at bash browse/scripts/build-node-server.sh, then hits the || true at the tail of the chain, which swallows the failure code. The downstream steps in the same chain are skipped:
So a macOS user's upgrade path silently ends up with:
no browse/dist/.version marker (upgrade-check code paths lose the SHA)
no design/dist/.version marker
no explicit chmod +x on the new binaries (probably still executable from --compile, but the belt-and-braces is gone)
stray .*.bun-build temp files not cleaned
Setup still prints gstack ready (claude) after, so it's easy to miss. I only noticed because I was watching the output during an adversarial code review.
Side suggestion
Independent of whether you go with --outdir + --entry-naming (the fix already proposed in this issue), consider also wrapping build-node-server.sh with an OS guard so it exits early on non-Windows:
The script's own header comment says this bundle is Windows-only (bun can't drive Playwright there per oven-sh/bun#4253). Everyone else is paying the bun-build cost for something they'll never use. Early-exit also makes the original bug unreachable on macOS/Linux even without the --outdir change.
Happy to open a small PR for the early-exit if it'd help.
Apple Silicon + Linux testing: Finally pulled the trigger on a new MacBook Pro (M-series Max, 128 GB) — my current Intel Mac is well overdue for retirement. I work from home most days, but I have access to Apple Silicon Mac minis when I'm next in the office (likely Thursday or Friday next week), plus a personal desktop running Omarchy (DHH's Arch Linux) I can hit right now. Three surfaces to validate any fix against: arm64 macOS (office Mac mini end of next week, personal MBP later), x86_64 macOS (current), and x86_64 Linux (Omarchy, anytime). Happy to post validation back here within a day or two of whichever fix lands.
Setup continues past the error and the native macOS browse binary compiles fine, so it's non-fatal on Mac — but server-node.mjs is never written, so any Windows-compat codepath that touches it would fail. The --outdir + --entry-naming fix in the original report looks right and should be platform-agnostic.
can someone with more credibility than me [I'm just a computer since student and this is literally my first issue in a public repo ever...] create a PR so we can mark this as resolved?
Another data point: Windows 11 + Bun 1.3.12 + gstack v0.16.3.0 (c6e6a21). Same cannot write multiple output files without an output directory at build-node-server.sh.
Here's an alternative fix that keeps --outfile and avoids shipping the 10 MB ngrok.win32-x64-msvc.node asset into dist/ — externalize @ngrok/ngrok so it's resolved from node_modules at runtime, the same way playwright / playwright-core / diff / bun:sqlite already are:
Keeps the existing single-file output intent (no script rework downstream).
@ngrok/ngrok is already present in node_modules next to the bundle, so require("@ngrok/ngrok") resolves natively at runtime — same pattern as the other externals.
dist/ stays ~10 MB leaner; only server-node.mjs (~317 KB) and bun-polyfill.cjs are written.
Activity
acsezen commentedon Apr 11, 2026
+1 / extra data point: this isn't Windows-specific — the same
bun buildinvocation fails on Linux too.Repro on Linux x86_64:
Linux 6.17.0-20-generic1.3.12v0.16.3.0(c6e6a21)browse/scripts/build-node-server.sh:17-23Output:
On Linux, ngrok emits
ngrok.linux-x64-gnu.node(same ~10 MB native addon, different triple), andbun build --outfilerejects the multi-output emission the same way. The failure is just hidden on Linux/macOS becausebrowse/src/cli.ts:80-83only hard-fails onserver-node.mjsmissing whenprocess.platform === 'win32'— non-Windows users keep running against whatever staleserver-node.mjsis left indist/.Side effect worth flagging:
./setuplogs the error but exits 0 (the build script fails thebun buildstep but the rest of setup is in a separate shell context, so setup reports "gstack ready" despite the broken bundle). Easy to miss in install output.The proposed fix (
--outdir+--entry-naming) should solve both platforms at once — confirmed the--outfilepath is the sole failure point in my repro. Happy to test a PR on Linux if useful.BenjaminDSmithy commentedon Apr 11, 2026
Also hitting this on macOS 15.7.4 (Sequoia) x86_64 with bun 1.3.11 on gstack v0.16.3.0 (commit
c6e6a21). So the "multiple output files" error is confirmed on Windows 11, Linux x86_64, and macOS Intel — fully cross-platform at this point regardless of ngrok.Surfaced mid-
./setupduring a routine0.16.2.0 → 0.16.3.0upgrade via/gstack-upgrade:Non-obvious downstream impact
Even on macOS where
server-node.mjsisn't strictly needed (bun drives Playwright directly), the failure has a silent side effect. Thebun run buildchain inpackage.json:11breaks atbash browse/scripts/build-node-server.sh, then hits the|| trueat the tail of the chain, which swallows the failure code. The downstream steps in the same chain are skipped:So a macOS user's upgrade path silently ends up with:
browse/dist/.versionmarker (upgrade-check code paths lose the SHA)design/dist/.versionmarkerchmod +xon the new binaries (probably still executable from--compile, but the belt-and-braces is gone).*.bun-buildtemp files not cleanedSetup still prints
gstack ready (claude)after, so it's easy to miss. I only noticed because I was watching the output during an adversarial code review.Side suggestion
Independent of whether you go with
--outdir+--entry-naming(the fix already proposed in this issue), consider also wrappingbuild-node-server.shwith an OS guard so it exits early on non-Windows:The script's own header comment says this bundle is Windows-only (bun can't drive Playwright there per oven-sh/bun#4253). Everyone else is paying the bun-build cost for something they'll never use. Early-exit also makes the original bug unreachable on macOS/Linux even without the
--outdirchange.Happy to open a small PR for the early-exit if it'd help.
Apple Silicon + Linux testing: Finally pulled the trigger on a new MacBook Pro (M-series Max, 128 GB) — my current Intel Mac is well overdue for retirement. I work from home most days, but I have access to Apple Silicon Mac minis when I'm next in the office (likely Thursday or Friday next week), plus a personal desktop running Omarchy (DHH's Arch Linux) I can hit right now. Three surfaces to validate any fix against: arm64 macOS (office Mac mini end of next week, personal MBP later), x86_64 macOS (current), and x86_64 Linux (Omarchy, anytime). Happy to post validation back here within a day or two of whichever fix lands.
fix(browse): skip node bundle build on non-windows
nischal94 commentedon Apr 11, 2026
Also reproduces on macOS arm64 during
./setup, not just Windows:Setup continues past the error and the native macOS
browsebinary compiles fine, so it's non-fatal on Mac — butserver-node.mjsis never written, so any Windows-compat codepath that touches it would fail. The--outdir+--entry-namingfix in the original report looks right and should be platform-agnostic.RonieKrasniker commentedon Apr 13, 2026
can someone with more credibility than me [I'm just a computer since student and this is literally my first issue in a public repo ever...] create a PR so we can mark this as resolved?
miyashita337 commentedon Apr 14, 2026
Another data point: Windows 11 + Bun 1.3.12 + gstack v0.16.3.0 (c6e6a21). Same
cannot write multiple output files without an output directoryatbuild-node-server.sh.Here's an alternative fix that keeps
--outfileand avoids shipping the 10 MBngrok.win32-x64-msvc.nodeasset intodist/— externalize@ngrok/ngrokso it's resolved fromnode_modulesat runtime, the same wayplaywright/playwright-core/diff/bun:sqlitealready are:Rationale:
@ngrok/ngrokis already present innode_modulesnext to the bundle, sorequire("@ngrok/ngrok")resolves natively at runtime — same pattern as the other externals.dist/stays ~10 MB leaner; onlyserver-node.mjs(~317 KB) andbun-polyfill.cjsare written.Verified end-to-end on Windows 11:
Either fix works; sharing in case the externalize approach fits the codebase better. Happy to send a PR if preferred.
garrytan commentedon Apr 16, 2026
Closing — this is the same @ngrok/ngrok Windows build issue reported across multiple issues. Tracking fix separately.
fix(browse): externalize @ngrok/ngrok so Node server bundle builds on…
chore: bump to v0.18.0.1 for ngrok Windows fix + CI error-propagation
fix: ngrok Windows build + close CI error-swallowing gap (v0.18.0.1) (#…
fix: ngrok Windows build + close CI error-swallowing gap (v0.18.0.1) (g…