From 861fe2e505a26d93b6f54c960ee777ff7d63a6d4 Mon Sep 17 00:00:00 2001 From: Garry Tan Date: Fri, 14 Aug 2026 19:30:07 -0700 Subject: [PATCH] fix(build): escape literal braces in the bun:sqlite stub regex Perl >= 5.26 treats an unescaped literal `{` in a pattern as fatal ("Unescaped left brace in regex is illegal"), so build-node-server.sh died at the bun:sqlite stub substitution on modern perl. Escape both braces; the replacement output is unchanged. Closes #2300. Contributed by @nuga0718 (PR #2111). Co-Authored-By: Claude Fable 5 --- browse/scripts/build-node-server.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/browse/scripts/build-node-server.sh b/browse/scripts/build-node-server.sh index 3ab652ac0..5ee2dd4d0 100755 --- a/browse/scripts/build-node-server.sh +++ b/browse/scripts/build-node-server.sh @@ -32,7 +32,7 @@ bun build "$SRC_DIR/server.ts" \ # Replace import.meta.dir with a resolvable reference perl -pi -e 's/import\.meta\.dir/__browseNodeSrcDir/g' "$DIST_DIR/server-node.mjs" # Stub out bun:sqlite (macOS-only cookie import, not needed on Windows) -perl -pi -e 's|import { Database } from "bun:sqlite";|const Database = null; // bun:sqlite stubbed on Node|g' "$DIST_DIR/server-node.mjs" +perl -pi -e 's|import \{ Database \} from "bun:sqlite";|const Database = null; // bun:sqlite stubbed on Node|g' "$DIST_DIR/server-node.mjs" # Step 3: Create the final file with polyfill header injected after the first line {