From f08b2bcb13aa720a7f83f5e0b232ed95630b27c4 Mon Sep 17 00:00:00 2001 From: yiekheng Date: Sun, 10 May 2026 22:20:23 +0800 Subject: [PATCH] fix(web): force-dynamic on /api/qr/[accountId] to unblock docker build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit next build's "Collecting page data" pass kept invoking the GET handler at build time, which hit the env proxy with no DATABASE_URL and threw ZodError again — this time on /api/qr, since /api/events was already force-dynamic. Mark the qr route force-dynamic + runtime=nodejs so Next skips the build-time call. Same pattern as /api/events. Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/web/src/app/api/qr/[accountId]/route.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/apps/web/src/app/api/qr/[accountId]/route.ts b/apps/web/src/app/api/qr/[accountId]/route.ts index 074099d..78b2612 100644 --- a/apps/web/src/app/api/qr/[accountId]/route.ts +++ b/apps/web/src/app/api/qr/[accountId]/route.ts @@ -1,6 +1,15 @@ import { NextResponse } from "next/server"; import { db } from "@/lib/db"; +// Without these, `next build`'s "Collecting page data" pass invokes +// the GET handler in the build container — which has no +// DATABASE_URL — and the env access throws ZodError, killing the +// docker build. Marking the route force-dynamic + nodejs runtime +// tells Next to skip the build-time call and only run at request +// time. +export const dynamic = "force-dynamic"; +export const runtime = "nodejs"; + interface RouteContext { params: Promise<{ accountId: string }>; }