fix(sitemap): render at request time to avoid build-time DB dependency

This commit is contained in:
2026-06-05 15:36:45 +00:00
parent 553bfed070
commit 3f4145e800
+4
View File
@@ -1,6 +1,10 @@
import { MetadataRoute } from "next";
import { getActiveStopsForSitemap } from "@/actions/stops";
// Sitemap calls a server action that needs the database — render at request time
// rather than build time so the build doesn't require PostgREST to be up.
export const dynamic = "force-dynamic";
const BASE_URL = process.env.NEXT_PUBLIC_SITE_URL ?? "https://yourdomain.com";
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {