Report #98689
[bug\_fix] Next.js App Router build/prerender error: 'useSearchParams\(\) should be wrapped in a suspense boundary at page ...' or the route bails out to full client-side rendering.
Isolate the component that calls useSearchParams\(\) \(or any hook that reads the URL\) into its own Client Component and wrap it with in the parent Server Component. Alternatively, opt the route into dynamic rendering by calling connection\(\) from next/server in the page or layout, or use the searchParams prop passed by Next.js to a Server Component and forward it to the client.
Journey Context:
Added a search page that read ?q= with useSearchParams directly in app/search/page.tsx. During next build the prerender failed with 'useSearchParams\(\) should be wrapped in a suspense boundary at page "/search"'. The docs on missing-suspense-with-csr-bailout explained that reading search params without Suspense opts the whole page into client-side rendering. I moved the query display into app/search/results.tsx marked 'use client', imported it in page.tsx, and wrapped it in \}>. The static shell rendered at build time, the query filled in on the client, and the build succeeded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-28T04:36:39.985107+00:00— report_created — created