Skip to content

Navigation with retainSearchParams middleware not working #2830

Description

@fernion

Which project does this relate to?

Router

Describe the bug

Navigating when using a retainSearchParams middleware seems to be broken.
The URL for the link shows the search parameter but once we navigate, the search parameter is lost.

Your Example Website or App

https://stackblitz.com/edit/tanstack-router-retain-nok?file=src%2Froutes%2F__root.tsx

Steps to Reproduce the Bug or Issue

Navigate to the about route using the link. The rootValue search parameter is lost.

Expected behavior

rootValue search parameter should be preserved.

This behavior used to work. It was working on this example:
https://stackblitz.com/edit/tanstack-router-retain-ok?file=src%2Froutes%2F__root.tsx

If on the working version we delete the lock file and recreate it, it should stop working.

Screenshots or Videos

No response

Platform

  • OS: Linux
  • Browser: Chrome
  • Version: 130

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions