A background fetcher error can remove loader data that a pending navigation has selected for reuse. Navigation then completes without reloading the missing data, leaving layout and child content absent.
Reproduction
This is separate from #15547: it still reproduces with the merge-preservation fix in #15545 applied.
Test-only reproduction commit, without the recovery fix:
git clone --branch luke/recover-invalidated-loader-data \
https://github.com/lukebowerman/react-router.git
cd react-router
git checkout 3ceea973e
pnpm install
pnpm test packages/react-router/__tests__/router-loader-data-test.tsx \
--runInBand -t 'loads a skipped layout if a background error removes its data before commit'The isolated test uses createMemoryRouter and RouterProvider, with deferred promises controlling this sequence:
- Start a navigation that reuses existing layout data because
shouldRevalidatereturnsfalse. - While the destination’s child loader is pending, fail a background fetcher reload at an ancestor error boundary, removing the layout data.
- Complete the destination’s child loader.
- Assert that navigation never commits an idle destination with required layout data missing, and that the layout reloads successfully.
The test fails before recovery is implemented. The same background-error race also reproduces on unmodified upstream main.
The proposed recovery fix is #15550. Its tests additionally cover destination error boundaries, replacement errors and redirects, cancellation, and newer fetcher takeover, including hash navigation. Nine cases fail without recovery; all 15 cases in the test file pass with it.
System Info
Reproduced in Data Mode against upstream source at 2d9827bc09bc562647553f8abf026823e3bfd9dd, with the merge-preservation fix applied. The workspace declares React Router 8.4.0; this is a source-checkout reproduction.
System:
OS: macOS 26.6.2
CPU: Apple M5 Max, arm64
Binaries:
Node: 24.16.0
npm: 11.13.0
pnpm: 11.7.0
Browsers:
Chrome: 153.0.8010.53
Firefox: 151.0
Safari: 27.0
npmPackages:
vite: 7.3.1Used Package Manager
pnpm
Expected Behavior
If a concurrent background error removes loader data selected for reuse, navigation should reload the missing data before completing. The destination should render its layout and child content, with genuine loader failures handled by the appropriate error boundary.
Actual Behavior
Navigation becomes idle at the destination with required layout data missing. The layout loader was skipped before the background error removed its data, and navigation does not reconsider that decision before committing. Layout and child content remain absent.
Source: remix-run/react-router