diff --git a/.changeset/tricky-lemons-warn.md b/.changeset/tricky-lemons-warn.md new file mode 100644 index 000000000000..c4947a560131 --- /dev/null +++ b/.changeset/tricky-lemons-warn.md @@ -0,0 +1,5 @@ +--- +"wrangler": patch +--- + +fix: appropriately fail silently when the open browser command doesn't work diff --git a/packages/wrangler/src/pages.tsx b/packages/wrangler/src/pages.tsx index f257ed6de800..55aecf50d97c 100644 --- a/packages/wrangler/src/pages.tsx +++ b/packages/wrangler/src/pages.tsx @@ -938,9 +938,9 @@ export const pages: BuilderCallback = (yargs) => { console.log(`Serving at http://127.0.0.1:${port}/`); if (process.env.BROWSER !== "none") { - try { - await open(`http://127.0.0.1:${port}/`); - } catch {} + const childProcess = await open(`http://127.0.0.1:${port}/`); + // fail silently if the open command doesn't work (e.g. in GitHub Codespaces) + childProcess.on("error", (_err) => {}); } if (directory !== undefined && liveReload) {