fix(build): add force-dynamic to server components with auth/DB access
Next.js "Collecting page data" worker crashes silently when a server component calls auth() or prisma without DATABASE_URL at build time. force-dynamic skips static generation for these pages entirely. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { auth } from "@/lib/auth";
|
import { auth } from "@/lib/auth";
|
||||||
import AdminConfigForm from "./AdminConfigForm";
|
import AdminConfigForm from "./AdminConfigForm";
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
import { auth } from "@/lib/auth";
|
import { auth } from "@/lib/auth";
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { SidebarNav, BottomNav } from "@/components/nav";
|
import { SidebarNav, BottomNav } from "@/components/nav";
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
export const dynamic = "force-dynamic";
|
||||||
|
|
||||||
import { redirect } from "next/navigation";
|
import { redirect } from "next/navigation";
|
||||||
import { auth } from "@/lib/auth";
|
import { auth } from "@/lib/auth";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user