router
router copied to clipboard
Router is stuck in displaying the loading component when an error is thrown from `beforeLoad`
Describe the bug
When an error is thrown from the beforeLoad option of a route and the router is configured with pending component, it seems that the router remains stuck in displaying the pending component.
If I remove the pending component it doesn't display anything.
Your Example Website or App
https://stackblitz.com/edit/tanstack-router-g8hajv?file=src%2Fmain.tsx
Steps to Reproduce the Bug or Issue
- Check the demo from the link
- See how the pending component is displayed indefinitely
- You can toggle the defaultPendingComponent to test without the pending mode
Expected behavior
I was expecting to see the error component in both cases: with and without the pending component.
Screenshots or Videos
No response
Platform
- OS: macOS
- Browser: Chrome
- @tanstack/react-router: 1.51.0
Additional context
No response
Hello, I'm experiencing the same issue.
When using the tanstack devtools, if resolve the promise manually in scripts.loadPromise, it shows the error component. Also, in the status, it is in pending.