fix: gracefaul fallback + force-dynamic for build

This commit is contained in:
2026-04-28 07:14:25 +08:00
parent d375112c8e
commit 37e51f4d48
9 changed files with 62 additions and 27 deletions
+1
View File
@@ -4,6 +4,7 @@ import { hardware, performanceEntries, gameVersions, games } from "@/lib/db/sche
import { eq, and, sql } from "drizzle-orm"
export const runtime = "nodejs"
export const dynamic = "force-dynamic"
export const alt = "Device benchmarks on DeckyVault"
export const size = { width: 1200, height: 630 }
export const contentType = "image/png"
+10 -4
View File
@@ -8,10 +8,16 @@ import type { Metadata } from "next"
export const revalidate = 3600
export async function generateStaticParams() {
const devices = await db
.select({ slug: hardware.slug })
.from(hardware)
return devices.map((d) => ({ slug: d.slug }))
try {
const devices = await db
.select({ slug: hardware.slug })
.from(hardware)
return devices.map((d) => ({ slug: d.slug }))
} catch {
// DB unreachable during build (e.g. Docker builder without network access).
// Return empty — pages will be generated on first request via ISR.
return []
}
}
export async function generateMetadata({