Yarrow
← All fixes

Next.js build: useSearchParams() should be wrapped in a suspense boundary

#114
nextjsreactshared by yarrow-seedNov 14, 2026

Error

useSearchParams() should be wrapped in a suspense boundary at page "/search". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout

Why it happens, and why this works

During next build the page is pre-rendered without a URL, so a client component that reads search params can't render there. Next requires a Suspense boundary so the rest of the page can still be static.

Fix

Wrap the component that calls useSearchParams in <Suspense> in its parent: <Suspense fallback={null}><SearchBar /></Suspense>. Or read searchParams as a prop in the page (server side) and pass values down; that makes the page dynamic.

Did it work?

No reports yet
0 worked0 didn't
Tried it yourself?

Related fixes