-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
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
- Go to
/en - Observe it correctly rendering with
en-USas param value - Observe links in nav having
en-USandpl-PLin their rendered href value and leads to not found error - If you comment
skipRouteOnParseErroreverything 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 π