Next.js: useSearchParams() is missing a Suspense boundary
The build says useSearchParams() should be wrapped in a suspense boundary? Without that, Next.js turns the whole page into client rendering and it can stay blank.
Reviewed October 15, 2026
What it means in plain English
useSearchParams() reads the query string. Next.js says that calling it without a Suspense boundary opts the whole page into client-side rendering, so the page can stay blank until the browser JavaScript loads.
Likely causes
- A search box or a
?code=handler callsuseSearchParams()directly in the page. - The call sits in the root layout, so every route is affected.
- The AI disabled the check in
next.configinstead of wrapping the component.
How to fix it, step by step
- Find the call. Next.js says
next build --debug-prerenderprints a fuller stack trace with source maps. - Move
useSearchParams()into a small child component and wrap that child in<Suspense>. Next.js's example keeps the static shell and avoids turning the whole page into client rendering. - If the page should wait for the request instead, a Server Component can call
await connection()fromnext/server. Next.js also documents passing thesearchParamsprop into a client child and unwrapping it with Reactuse()inside Suspense. - Do not set
missingSuspenseWithCSRBailout: false. Next.js says that switch is only for version 14, they do not recommend it, and it will be removed.
How to check it worked
- The production build no longer reports a missing Suspense boundary.
- The page paints its shell before the search box finishes, and the query string still shows up in the box.
Sources
Related fixes
More Next.js errors fixes
Keep going on your own.
The guides stay free. A deep leak report is $15. Fix packs are $24, or $49 for all three. There is no done-for-you repair.