diff --git a/cannamanage-frontend/Dockerfile b/cannamanage-frontend/Dockerfile index 346b785..45039fe 100644 --- a/cannamanage-frontend/Dockerfile +++ b/cannamanage-frontend/Dockerfile @@ -20,6 +20,7 @@ ENV AUTH_SECRET=build-time-placeholder-secret-minimum-32-characters ENV NEXTAUTH_SECRET=build-time-placeholder-secret-minimum-32-characters ENV AUTH_TRUST_HOST=1 ENV BACKEND_URL=http://localhost:8080 +ENV BASE_URL=http://localhost:3000 RUN pnpm build FROM base AS runner diff --git a/cannamanage-frontend/src/app/layout.tsx b/cannamanage-frontend/src/app/layout.tsx index bf48909..39af928 100644 --- a/cannamanage-frontend/src/app/layout.tsx +++ b/cannamanage-frontend/src/app/layout.tsx @@ -22,7 +22,10 @@ export const metadata: Metadata = { default: "CannaManage", }, description: "Cannabis club management platform — CannaManage", - metadataBase: new URL(process.env.BASE_URL as string), + // Guard against undefined BASE_URL: `new URL(undefined)` throws ERR_INVALID_URL + // during Next.js "Collecting page data" (root layout metadata is evaluated for + // every route). Falls back to localhost; real value injected at runtime via env. + metadataBase: new URL(process.env.BASE_URL ?? "http://localhost:3000"), manifest: "/manifest.json", themeColor: "#2ECC71", appleWebApp: {