Skip to main content
GoodFirstPicks
DashboardIssuesReposLeaderboard

GoodFirstPicks by Leaveitblank © 2026

CreatorRequest a RepoPrivacy PolicyTerms of Service
useSearchParams() should not need to be wrapped in a suspense boundary | GoodFirstPicks

useSearchParams() should not need to be wrapped in a suspense boundary

vercel/next.js 22 comments 1mo ago
View on GitHub
mediumopenScope: somewhat clearSkill match: maybeNext.jsTypeScriptReact

Why this is a good first issue

The issue involves both documentation updates and potential behavioral changes in a core hook.

AI Summary

The issue reports that `useSearchParams()` requires a Suspense boundary despite documentation suggesting otherwise, and an experimental flag mentioned in docs no longer exists. It requires verifying current behavior and updating documentation, with potential changes to the hook's requirements.

Issue Description

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/nameless-cookies-go8s7s

To Reproduce

  1. Write a page that calls useSearchParams from next/navigation
  2. Make it a client component by adding "use client" at the top
  3. run npm run build
  4. observe error useSearchParams() should be wrapped in a suspense boundary at page "/test". Read more: https://nextjs.org/docs/messages/missing-suspense-with-csr-bailout

Current vs. Expected behavior

  1. The documentation associated with this error is no longer accurate- the linked page suggests to disable the error by adding the experimental feature missingSuspenseWithCSRBailout to next.config.js. This option does not work, and will cause the build to error out saying that feature/flag doesn't exist.
  2. I don't see why useSearchParams is any different WRT suspense than any other client function like useState. I don't need suspense for them, and I don't see why I should need suspense for useSearchParams
  3. This is not a problem in development- it neither gives an error nor has incorrect behavior.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:02:26 PDT 2024; root:xnu-11215.41.3~2/RELEASE_ARM64_T8122
  Available memory (MB): 16384
  Available CPU cores: 8
Binaries:
  Node: 20.17.0
  npm: 10.8.2
  Yarn: 1.22.22
  pnpm: 9.15.0
Relevant Packages:
  next: 15.1.3 // Latest available version is detected (15.1.3).
  eslint-config-next: 15.1.3
  react: 19.0.0
  react-dom: 19.0.0
  typescript: 5.7.2
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure, Documentation

Which stage(s) are affected? (Select all that apply)

next build (local)

Additional context

The linked codesandbox is on the latest canary, and the issue still appears.

Want to work on this?

Claim this issue to let others know you're working on it. You'll earn 20 points when you complete it!

Risk Flags

  • documentation inaccuracy
  • experimental feature removal
Loading labels...

Details

Points20 pts
Difficultymedium
Scopesomewhat clear
Skill Matchmaybe
Test Focusedno