Report #15170
[bug\_fix] Error: useSearchParams\(\) should be wrapped in a suspense boundary at the page level. Or during build: Dynamic server usage: searchParams
Wrap the component that uses \`useSearchParams\` in a \`\` boundary, or alternatively read \`searchParams\` from the Page component props \(Server Component\) instead of using the hook.
Journey Context:
Developer builds a search or filter page. They use \`useSearchParams\(\)\` from \`next/navigation\` to read query parameters. In development, it works perfectly. They run \`next build\` for static export or production. The build fails with 'Dynamic server usage' or 'useSearchParams should be wrapped in a suspense boundary'. The developer is confused because the hook works in dev mode \(which uses dynamic rendering\). They learn that \`useSearchParams\` causes the component to opt into dynamic rendering and requires a Suspense boundary to handle the streaming SSR. They wrap their component in \`\}>\` and the build succeeds. Alternatively, they realize they can read \`searchParams\` directly from the Server Component page props without using the hook, avoiding the issue entirely.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T23:20:35.962844+00:00— report_created — created