From 2020e84f9427a17c30aecded53b7d14d367e405e Mon Sep 17 00:00:00 2001 From: Tanya Date: Wed, 7 Jan 2026 13:30:36 -0500 Subject: [PATCH] chore: Enforce dynamic rendering in viewer frontend pages to optimize build process This commit adds dynamic rendering to the main page, photo detail page, and search page in the viewer frontend. By enforcing dynamic rendering, we prevent database queries during the build process, enhancing application performance and reliability. These changes contribute to a more efficient development workflow and improve the overall user experience. --- viewer-frontend/app/page.tsx | 3 +++ viewer-frontend/app/photo/[id]/page.tsx | 3 +++ viewer-frontend/app/search/page.tsx | 3 +++ 3 files changed, 9 insertions(+) diff --git a/viewer-frontend/app/page.tsx b/viewer-frontend/app/page.tsx index bf43768..03e02a7 100644 --- a/viewer-frontend/app/page.tsx +++ b/viewer-frontend/app/page.tsx @@ -4,6 +4,9 @@ import { HomePageContent } from './HomePageContent'; import { Photo } from '@prisma/client'; import { serializePhotos, serializePeople, serializeTags } from '@/lib/serialize'; +// Force dynamic rendering to prevent database queries during build +export const dynamic = 'force-dynamic'; + async function getAllPeople() { try { return await prisma.person.findMany({ diff --git a/viewer-frontend/app/photo/[id]/page.tsx b/viewer-frontend/app/photo/[id]/page.tsx index 7bbe307..dd63e87 100644 --- a/viewer-frontend/app/photo/[id]/page.tsx +++ b/viewer-frontend/app/photo/[id]/page.tsx @@ -3,6 +3,9 @@ import { PhotoViewerClient } from '@/components/PhotoViewerClient'; import { prisma } from '@/lib/db'; import { serializePhoto, serializePhotos } from '@/lib/serialize'; +// Force dynamic rendering to prevent database queries during build +export const dynamic = 'force-dynamic'; + async function getPhoto(id: number) { try { const photo = await prisma.photo.findUnique({ diff --git a/viewer-frontend/app/search/page.tsx b/viewer-frontend/app/search/page.tsx index f83f392..379cddd 100644 --- a/viewer-frontend/app/search/page.tsx +++ b/viewer-frontend/app/search/page.tsx @@ -3,6 +3,9 @@ import { prisma } from '@/lib/db'; import { SearchContent } from './SearchContent'; import { PhotoGrid } from '@/components/PhotoGrid'; +// Force dynamic rendering to prevent database queries during build +export const dynamic = 'force-dynamic'; + async function getAllPeople() { try { return await prisma.person.findMany({