T
TanStack3d ago
flat-fuchsia

Why does throwing a redirect in the route loaders post RC trigger an error?

I've successfully upgraded a codebase to RC before I noticed something that wasn't there pre-RC. The router docs clearly say that you can throw a redirect from the beforeLoad or loader fn of a route. Now, on RC, throwing redirects from the loaders trigger an error. Maybe I'm making a mistake somewhere. Why is this happening and how can I resolve it?
No description
5 Replies
helpful-purple
helpful-purple3d ago
can you please provide a complete reproducer ?
flat-fuchsia
flat-fuchsiaOP2d ago
Sorry, my bad. I was throwing a redirect in a try-catch.
helpful-purple
helpful-purple2d ago
so works as expected then?
flat-fuchsia
flat-fuchsiaOP2d ago
Yes. Thank you.
helpful-purple
helpful-purple2d ago
great!

Did you find this page helpful?