Skip to content

Commit 76dd228

Browse files
authored
fix(web): skip empty APP_URL_OVERRIDE export in dev (#3056)
Regression from d773511. Unconditionally exporting APP_URL_OVERRIDE made process.env.APP_URL_OVERRIDE an empty string when nothing in the env files defined it, which defeats the `??` fallback in apps/web/src/lib/constants.ts and crashes Turbopack with 'Invalid URL' at `new URL(APP_URL)` in app/layout.tsx. Only export when non-empty so the variable stays undefined and the localhost fallback fires.
1 parent 9babcb3 commit 76dd228

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

scripts/dev.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ export PORT
6969
APP_URL_OVERRIDE="${APP_URL_OVERRIDE:-$(read_env_value APP_URL_OVERRIDE)}"
7070
NEXTAUTH_URL="${NEXTAUTH_URL:-$(read_env_value NEXTAUTH_URL)}"
7171
NEXT_DEV_HOSTNAME="${NEXT_DEV_HOSTNAME:-0.0.0.0}"
72-
export APP_URL_OVERRIDE
72+
# Only export APP_URL_OVERRIDE when set; an empty export becomes "" in
73+
# process.env and defeats the `??` fallback in apps/web/src/lib/constants.ts.
74+
if [ -n "$APP_URL_OVERRIDE" ]; then
75+
export APP_URL_OVERRIDE
76+
fi
7377
export NEXT_DEV_HOSTNAME
7478
export NEXTAUTH_URL="${NEXTAUTH_URL:-${APP_URL_OVERRIDE:-http://localhost:$PORT}}"
7579
exec next dev -H "$NEXT_DEV_HOSTNAME" -p "$PORT" "$@"

0 commit comments

Comments
 (0)