Returning not found for invalid path params
I'd like to return a 404 error when a path parameter is invalid. I've tried doing this by throwing notFound from the params.parse function, but this just gives a generic 500 error. Is there a way to do this?
Example code (I want this to return 404 for /test/abc):
5 Replies
flat-fuchsia•4w ago
are you using router or start?
metropolitan-bronzeOP•4w ago
Start
flat-fuchsia•4w ago
might be a bug. can you please create a github issue including a complete reproducer project?
metropolitan-bronzeOP•4w ago
Thanks - issue is here: https://github.com/TanStack/router/issues/5733
GitHub
notFound in parameter parser returns 500, not 404 · Issue #5733 ...Which project does this relate to? Router Describe the bug I have a parse function for path parameters, which throws a notFound error when the parameters aren't in the required format. For exam...
metropolitan-bronzeOP•4w ago
GitHub
GitHub - matt-thomson/tanstack-validate-not-found: Example showing ...
Example showing not found issue in Tanstack Start route validator - matt-thomson/tanstack-validate-not-found