Short answer
Move the code that calls useSearchParams() into a small Client Component and wrap it in <Suspense>. That keeps the rest of the page static. If the whole route should render on each request instead, call connection() in the Server Component page. To find the component, run next build --debug-prerender.
Why the build fails, and the fix
01
A component reads useSearchParams() with no Suspense around it
“Reading search parameters through useSearchParams() without a Suspense boundary will opt the entire page into client-side rendering.” Next.js, Missing Suspense boundary with useSearchParams
Without a Suspense boundary, reading the query string would push the whole page to render in the browser, so the build stops. Wrap the smallest part that needs it, as in Next.js’s example:
'use client' import { useSearchParams } from 'next/navigation' import { Suspense } from 'react' function Search() { const searchParams = useSearchParams() return <input placeholder="Search..." /> } export function Searchbar() { return ( // You could have a loading skeleton as the `fallback` too <Suspense> <Search /> </Suspense> ) }02
The page should render on every request
“To make the route dynamically rendered, use the connection function in a Server Component (e.g. the Page or a wrapping Layout).” Next.js, Missing Suspense boundary with useSearchParams
If the page depends on the request anyway, make the route dynamic. Next.js says to call connection() in a Server Component page or layout. Setting dynamic in a Client Component page has no effect. On a Next.js version from before connection() existed, Next.js’s docs use export const dynamic = 'force-dynamic' in a Server Component page.tsx or layout.tsx instead.
import { connection } from 'next/server' export default async function Page() { await connection() return <div>...</div> }03
The whole page became a Client Component
“Consider making the Page a Server Component again and isolating Client-only code (that uses useSearchParams) into child Client Components.” Next.js, Missing Suspense boundary with useSearchParams
A page.tsx that starts with 'use client' makes the whole page a Client Component. Next.js suggests making it a Server Component again and keeping the code that uses useSearchParams in child Client Components.
Checked against the vendor’s docs on : Next.js docs: Missing Suspense boundary with useSearchParams.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug in an existing mobile or web app, diagnosed and fixed.See scope and start
- from $450AI-Built App RescueA Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way.See scope and start
Related: Next.js hydration error · Build failed on Netlify or Vercel