[bug] TanStack Router adapter: search params with array of objects serialized as [object Object]
Context
What's your version of nuqs?
"nuqs": "2.6.0"What framework are you using?
- ✅Other (TanStack Router)
Which version of your framework are you using?
"@tanstack/react-router": "1.x"
"react": "18.x"Description
When using Nuqs with the TanStack Router adapter,
search params containing objects or arrays of objects are incorrectly serialized into strings like: [object Object]
This causes parsing errors when using parseAsJson or custom parsers (e.g. shadcn-table sorting state).
Expected behavior:
The adapter should follow TanStack Router’s default serialization (JSON.stringify / JSON.parse) so that objects/arrays are stored as valid JSON strings in the URL.
We previously discussed this issue here: https://github.com/47ng/nuqs/pull/953#issuecomment-3272900821
Reference docs:
https://tanstack.com/router/latest/docs/framework/react/guide/custom-search-param-serialization
Reproduction
Source: 47ng/nuqs