T
TanStack2y ago
flat-fuchsia

Error in beforeLoad not triggering global ErrorComponent

I've got a beforeLoad on my main layout that can receive an error from my API. When I receive the error, I get the default white-page Tanstack error, instead of the component I've set as my root route's errorComponent. Is there a reason why this is?
2 Replies
yappiest-sapphire
yappiest-sapphire2y ago
can you please provide a minimal example on e.g. codesandbox?
afraid-scarlet
afraid-scarlet2y ago
hit the same thing, I can reproduce it (or something similar) without beforeLoad: https://codesandbox.io/p/sandbox/nice-bose-7rtgty I'm expecting both / and /about to show the same error component - is that not how it should work? looking through the code, I guess the intent is to use the defaultErrorComponent on the router for these cases

Did you find this page helpful?