fix: docker build crash when STORAGE_PUBLIC_URL unset
compose.prod.yml passes STORAGE_PUBLIC_URL through ${STORAGE_PUBLIC_URL}
build args/env — when unset in .env.production, docker-compose
substitutes an empty string, not an absent var. ?? only falls back on
null/undefined, so next.config.ts's `new URL("")` threw and failed the
whole `pnpm --filter web build` step. Switched to || in next.config.ts
and lib/storage.ts so empty string also falls back to the default.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import type { NextConfig } from "next";
|
||||
|
||||
const storagePublicUrl = process.env["STORAGE_PUBLIC_URL"] ?? "http://localhost:9000";
|
||||
const storagePublicUrl = process.env["STORAGE_PUBLIC_URL"] || "http://localhost:9000";
|
||||
const storageUrl = new URL(storagePublicUrl);
|
||||
const storageOrigin = storageUrl.origin;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user