Report #55358
[bug\_fix] useSearchParams\(\) should be wrapped in a suspense boundary at page /search
Wrap the component that calls useSearchParams\(\) in a boundary in the parent Server Component. Root cause: useSearchParams causes the component to render dynamically based on request-time query strings; without Suspense, Next.js cannot statically generate the page shell during build time \(SSG\).
Journey Context:
Developer builds a search page app/search/page.tsx that uses const searchParams = useSearchParams\(\) to read ?q=term. During next build, the build fails with the exact error message suggesting a Suspense boundary. Developer tries adding 'use client' but the error persists. They search the Next.js docs for the error message and find that useSearchParams is a dynamic API. They refactor: create a ClientComponent 'use client' that calls useSearchParams, then in the parent page.tsx \(Server Component\), they wrap \}>. The build now succeeds because Next.js can prerender the Suspense fallback shell and stream the dynamic part.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T23:24:31.592533+00:00— report_created — created