Report #103771
[bug\_fix] Error: useSearchParams\(\) should be wrapped in a suspense boundary at page "/search". This component used props.searchParams or useSearchParams\(\) and was rendered without a Suspense boundary.
Wrap the smallest subtree that calls useSearchParams in a boundary, or read searchParams in a parent Server Component and pass them down as props. For dynamic routes, await connection\(\) or use export const dynamic = 'force-dynamic' in a Server Component so the route opts into request-time rendering instead of static prerendering.
Journey Context:
A developer builds a search page with an input that reads the current query via useSearchParams from next/navigation. In local dev everything looks fine, but next build fails with the suspense-boundary error. The root cause is that useSearchParams only exists on the client; during static generation Next.js sees the hook and must bail out the entire page to client-side rendering unless the bailout is contained inside Suspense. The developer first tries adding 'use client' to the page, which does not help because the issue is not server vs client but the lack of a Suspense boundary around the client-only subtree. The working fix is to extract the search input into its own Client Component and render it inside Suspense in the Server Component page. This keeps the static shell prerendered and only hydrates the search bar on the client. Alternatively, forcing dynamic rendering with connection\(\) lets the page read searchParams at request time without a Suspense boundary because nothing is prerendered.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-13T04:40:44.205839+00:00— report_created — created