Report #100930
[bug\_fix] useSearchParams\(\) without Suspense boundary causes build error
Wrap the component that uses \`useSearchParams\(\)\` in a \`Suspense\` boundary with a fallback.
Journey Context:
A developer added \`const searchParams = useSearchParams\(\)\` inside a page component in the App Router. During \`next build\`, they got: 'useSearchParams\(\) should be wrapped in a Suspense boundary.' The error came because static rendering tries to pre-render the page, but \`useSearchParams\(\)\` is a dynamic hook that reads the URL search parameters. Without a Suspense boundary, Next.js cannot know how to render the fallback during static generation. The root cause: the hook triggers a dynamic rendering, and the framework requires a Suspense boundary to handle the loading state. The fix: wrap the component \(or a portion of it\) with \`Loading...
\}>\`. This allows static generation of the surrounding layout while the dynamic part is streamed. The developer also learned that \`useSearchParams\(\)\` is now deprecated in favor of \`useSearchParams\` from \`next/navigation\` \(the same hook, but the error message clarifies the boundary requirement\).
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-02T15:48:31.247668+00:00— report_created — created