Commit 8874f7d
fix: capture match reference before redirect navigation removes it
Root cause: When loader throws redirect, the catch block calls
inner.router.navigate() which removes the old match from the router.
Then finally block tries getMatch(matchId) but returns undefined,
so promises never resolve, blocking Promise.allSettled.
Solution: Capture match reference BEFORE entering try block, so we
have a stable reference even if redirect removes it from router.
Flow with redirect:
1. Get matchForCleanup (captures reference)
2. runLoader throws redirect
3. Catch: navigate() removes match from router
4. Finally: Use matchForCleanup (still valid) to resolve promises
This allows Promise.allSettled to complete and navigation to proceed.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent 0cd8ff6 commit 8874f7d
1 file changed
+6
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
836 | 836 | | |
837 | 837 | | |
838 | 838 | | |
| 839 | + | |
| 840 | + | |
839 | 841 | | |
840 | 842 | | |
841 | 843 | | |
| |||
845 | 847 | | |
846 | 848 | | |
847 | 849 | | |
848 | | - | |
849 | | - | |
850 | | - | |
851 | | - | |
852 | | - | |
853 | | - | |
854 | | - | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
855 | 854 | | |
856 | 855 | | |
857 | 856 | | |
| |||
0 commit comments