Skip to content

Custom param parsing into an object only works with loader once, then loader stays stale #7964

Description

@njGroters

Which project does this relate to?

Start

Describe the bug

I have a route that uses custom param parsing with Valibot. When I use the parsed params in a loader for a page under that route, the first page visit works as expected. However, if I navigate back from that page and return with different params, the loader seems to get "stuck" with the parsed params from my first visit. Reloading that page updates the loader to re-run with the expected params, but navigating away and back will cause it to get stuck again.

It seems like this is a loader-specific issue. If I remove the loader, I no longer see this behavior (the params on the page stay in sync with the URL as I would expect). It almost feels like I'm missing loaderDeps, but that only has access to the search params, not the route params.

Complete minimal reproducer

https://github.com/njGroters/tanstack-param-parsing-reproduction

Steps to Reproduce the Bug

  1. On the home page, click on any of the links
  2. Note the params displayed on the page - they should match the URL state
  3. Click the "Home" link to return to the home page
  4. Click on any other link on the homepage
  5. See that the displayed params have not changed and are now out of sync with the URL state
  6. Reload the page to correct the displayed params
  7. Click the "Home" link
  8. Click another link
  9. See that the displayed params are stale again

Expected behavior

I would expect the parsed params to continue to match the URL state and be used in the loader on subsequent page visits.

Screenshots or Videos

Screen.Recording.2026-08-05.at.12.07.34.PM.mov

Platform

  • Router / Start Version: Latest
  • OS: macOS
  • Browser: Chrome, Firefox
  • Browser Version: Latest
  • Bundler: Vite
  • Bundler Version: Latest, ^7.3.1
  • Framework: SolidJS, ^1.9.11

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions