Thanks to visit codestin.com
Credit goes to github.com

Skip to content

skipRouteOnParseError causes incorrect param stringificationΒ #6490

@pawelblaszczyk5

Description

@pawelblaszczyk5

Which project does this relate to?

Router

Describe the bug

Hello πŸ‘‹
I've played a bit with the experimental skipRouteOnParseError feature, because it solves a real problem for me. However, what I've spotted is that it interferers with custom param parse/stringify flow.

Simple example - parsing language from URL like "en" or "pl" into "en-US"/"pl-PL" so URL is nicer. Normally it works without problems and I can use everywhere in the code "en-US"/"pl-PL" but it's stringified to URL as "en"/"pl". However, if on the same route I enable skipRouteOnParseError - params are stringified as is - there's "en-US" and "pl-PL" in Link hrefs which causes notFound errors naturally.

Your Example Website or App

https://github.com/pawelblaszczyk5/tanstack-router-stringify-params-problem

Steps to Reproduce the Bug or Issue

  1. Go to /en
  2. Observe it correctly rendering with en-US as param value
  3. Observe links in nav having en-US and pl-PL in their rendered href value and leads to not found error
  4. If you comment skipRouteOnParseError everything works correctly

Expected behavior

Custom parse/stringify flow works correctly with skipRouteOnParseError

Screenshots or Videos

https://www.youtube.com/watch?v=bzO9AWej2Vo

Platform

  • Router / Start Version: 1.157.2
  • OS: macOS
  • Browser: All of them
  • Browser Version: N/A
  • Bundler: Vite
  • Bundler Version: 7.3.1

Additional context

Fully aware that this feature is still marked as experimental - reporting for visibility πŸ˜ƒ

Metadata

Metadata

Assignees

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