fix(web): force-dynamic on /api/qr/[accountId] to unblock docker build
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) <noreply@anthropic.com>
This commit is contained in:
parent
58b249097a
commit
f08b2bcb13
@ -1,6 +1,15 @@
|
|||||||
import { NextResponse } from "next/server";
|
import { NextResponse } from "next/server";
|
||||||
import { db } from "@/lib/db";
|
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 {
|
interface RouteContext {
|
||||||
params: Promise<{ accountId: string }>;
|
params: Promise<{ accountId: string }>;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user