T
TanStack2mo ago
rare-sapphire

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
like-gold
like-gold2mo ago
can you please provide a complete reproducer ?
rare-sapphire
rare-sapphireOP2mo ago
Sorry, my bad. I was throwing a redirect in a try-catch.
like-gold
like-gold2mo ago
so works as expected then?
rare-sapphire
rare-sapphireOP2mo ago
Yes. Thank you.
like-gold
like-gold2mo ago
great!

Did you find this page helpful?