From e20efe40ba38ad1c39c9cb73424fc2ffebcfe537 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Thu, 22 May 2025 09:52:24 +0000 Subject: [PATCH] Fix: Update PageProps for app/content/[slug]/page.tsx This commit resolves a persistent TypeScript build error: "Type 'ContentPageProps' does not satisfy the constraint 'PageProps'" in `app/content/[slug]/page.tsx`. The `ContentPageProps` interface has been updated to include the `searchParams` property, aligning it with the expected structure for Next.js page components in the App Router. This ensures compatibility with Next.js's internal type definitions for async server components. --- app/content/[slug]/page.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/content/[slug]/page.tsx b/app/content/[slug]/page.tsx index 9db268495..993bd15ef 100644 --- a/app/content/[slug]/page.tsx +++ b/app/content/[slug]/page.tsx @@ -30,15 +30,17 @@ async function getContent(slug: string) { return allContent[slug] || null; } -// Define an interface for the page's props +// Define an interface for the page's props, including searchParams interface ContentPageProps { params: { slug: string; }; - // searchParams?: { [key: string]: string | string[] | undefined }; // Optional, if needed + searchParams: { [key: string]: string | string[] | undefined }; } -export default async function ContentPage({ params }: ContentPageProps) { +export default async function ContentPage({ params, searchParams }: ContentPageProps) { + // searchParams is now destructured but not necessarily used if the page doesn't need it. + // This is to satisfy the PageProps constraint. const content = await getContent(params.slug); if (!content) {