Check out the list of known issues and solutions
on GitHub for community-reported problems and fixes.
Common Issues
nuqs requires an adapter to work with your framework
nuqs requires an adapter to work with your framework
Error: NUQS-404
This error occurs when you haven’t wrapped the components callinguseQueryState(s) with an adapter.Solution:Follow the setup instructions to import and wrap your application using a suitable adapter:- Next.js (app router)
- Next.js (pages router)
- React SPA (eg: with Vite)
- Remix
- React Router
- TanStack Router
nuqs/adapters/testing.In monorepos:This error can occur when components using nuqs hooks are in different packages resolving
to different nuqs versions. Make sure that all packages resolve to the same version
of nuqs. See issue #798 for more details.URL update rate-limited by the browser
URL update rate-limited by the browser
Error: NUQS-429
This error occurs when too many URL updates are attempted in a short period of time, such as connecting a query state to a text input or slider.Solution:The library has a built-in throttling mechanism that can be configured:- 100 updates per 30 seconds (Safari 16 and earlier)
- 100 updates per 10 seconds (Safari 17+)
Max Safe URL Length Exceeded
Max Safe URL Length Exceeded
Error: NUQS-414
This error occurs if your URL length exceeds 2,000 characters.Why this matters:- Some browsers have varying URL length limits
- Long URLs may not be processed by some servers
- URLs may break or be truncated
- Server state/data: Use TanStack Query or SWR
- Transient state: Use local React state
- Device-persistent state: Use localStorage
- Do I need it to persist across page refresh?
- Do I need to share it with others?
- Do I need to link to it from other places?
- Do I need to be able to bookmark it?
- Do I need Back/Forward buttons to navigate it?
- Is it always going to be a small amount of data?
Multiple versions of the library are loaded
Multiple versions of the library are loaded
Error: NUQS-409
This error occurs if two different versions ofnuqs are loaded in the same application.Common causes:- Using a package that embeds
nuqswhile also usingnuqsdirectly - Monorepo packages resolving to different versions
resolutions field in package.json to force all dependencies to use the same version:package.json
overrides:package.json
Missing Suspense boundary with useSearchParams
Missing Suspense boundary with useSearchParams
Next.js Error
You may have encountered this error message from Next.js:'use client' directive to your page:- Keep
page.tsxas a server component (no'use client'directive) - Move client-side features into a separate client file
- Wrap the client component in a
<Suspense>boundary
app/page.tsx
app/client.tsx
Framework-Specific Issues
Pages router returns null on SSR/SSG
Pages router returns null on SSR/SSG
Because the Next.js pages router is not available in an SSR context, hooks will
always return
null (or the default value if supplied) on SSR/SSG.Solution:This is a known limitation of the pages router. The app router does not have this limitation.If you need SSR support, consider:- Migrating to the app router
- Using
getServerSidePropsto pass initial values - Accepting that initial render will use default values
Usage Caveats
Different parsers on the same key
Different parsers on the same key
Hooks are synced together on a per-key basis. Using different parsers on the same
key can lead to unexpected states:Solution:Abstract a key/parser pair into a dedicated hook:
State not persisting across page navigations
State not persisting across page navigations
Debugging Tips
Enable debug logging
Enable debug logging
When troubleshooting issues, enable debug logging:Browser:Server:See the Debugging guide for more details.
Check the browser console
Check the browser console
Many issues will produce warnings or errors in the browser console.
Always check the console when experiencing unexpected behavior.Look for:
[nuqs]or[nuq+]prefixed messages- React warnings about missing keys or invalid state
- Network errors (when using
shallow: false)
Getting Help
If you’re still experiencing issues:- Search existing issues: Check GitHub Issues for similar problems
- Enable debug logs: Include debug output when reporting issues
- Create a minimal reproduction: Use CodeSandbox or StackBlitz
- Open a new issue: Provide:
- Environment details (framework, version, browser)
- Steps to reproduce
- Expected vs actual behavior
- Debug logs
- Minimal reproduction link
Providing debug logs when opening an issue
is always appreciated and helps resolve problems faster.