Skip to content

[bug]: Failed to construct 'URLSearchParams' when using nuqs with SortingState in TanStack Router #268

Description

@epenflow

Describe the bug

When using nuqs along side tanstack router/start to manage table state, attempting to update a sorting state results in runtime error Failed to construct 'URLSearchParams': Cannot convert object to primitive value. This appears to be serialization mismatch.

How to reproduce

How to reproduce

  1. Repo
  2. Setup a project with @tanstack/start and nuqs
  3. Define a search paramater using getSortingStateParser()
  4. Attempt to update the sort state
  5. Observe the console error when the router attempts to sync the state to the URL

Link to reproduction

https://github.com/epenflow/sorting

Additional information

Expected behavior

The sorting state should serialized into a query string and successfully synchronized with the URL via tanstack router

Actual behavior

The application crashes with the following error
Failed to construct 'URLSearchParams': Cannot convert object to primitive value

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions