Live Preview: Vercel 404 & 500 Error in Logs

In case anyone else experiences a strange day like me related to the Page changed from static to dynamic at runtime error. Here's what I was able to determine.

In my src/app/[uid]/page.tsx (page/server component), I am using searchParams. I was passing searchParams to the <SliceZone /> component. I'm not sure why it was a problem today and not the weeks before, but it gave me the above static to dynamic error. I was able to "fix" it by passing a pageNumber object rather than the entire searchParams.

type Params = { uid: string }
type SearchParams = {
  [key: string]: string | string[] | undefined
}

export default async function Page({
  params,
  searchParams,
}: {
  params: Params
  searchParams: SearchParams
}) {
  const client = createClient()
  const page = await client.getByUID('page', params.uid).catch(() => notFound())
  const pageNumber = { page: searchParams.page }
  return (
    <SliceZone
      slices={page.data.slices}
      components={components}
      context={pageNumber}
    />
  )
}

I now have my blog and projects back. This is done so I can handle pagination. I hope this saves someone someday.

I did not solve or address the page builder issues however.