Vercel build logs or `npm run build`
useSearchParams() should be wrapped in a suspense boundary at page "/…".
- What it means
- A client component reads URL query parameters with `useSearchParams()`, and Next.js needs a `<Suspense>` wrapper around it so the rest of the page can load immediately.
- Likely causes
- Using
useSearchParams()in a client component without wrapping that component in<Suspense fallback={...}>in its parent page. - Testing only with
npm run dev(which doesn't pre-build pages) instead of runningnpm run buildbefore pushing.
- Using
- Prevention
- Run
npm run buildlocally before opening a pull request to catch static build checks early.
Copy for your agent
The build failed with `useSearchParams() should be wrapped in a suspense boundary`. Wrap the component that calls `useSearchParams()` in `<Suspense>` and verify with `npm run build`.
Was this page helpful?