Skip to content

Conversation

joseph0926
Copy link
Contributor

Fixes: #14325

Fixes navigation errors that occur when browser storage (localStorage/sessionStorage) is blocked for any reason.
(In my case, I confirmed this occurs when “Do not save data” is enabled in Chrome.)

Problem

When users block cookies/storage in their browser settings, React Router v7 throws an unhandled SecurityError during client-side navigation, causing the application to show "Application Error" instead of navigating properly.

Solution

Added try-catch blocks around sessionStorage access in fog-of-war.ts to handle storage access errors,

Test Instructions

Manual Testing

  1. Visit https://reactrouter.com
  2. Open Chrome settings → Site settings → Cookies → Block all cookies
  3. Navigate to /docs page
  4. Go back to the home page(the security console error mentioned earlier appears here)
  5. Navigate to /docs page
  6. Page is broken

Integration Test

Added integration test in session-storage-denied-test.ts that simulates blocked storage and verifies navigation still works.

Note

Referencing other catch blocks, I did not add any separate logs or similar to the catch block. I simply left a comment.

Copy link

changeset-bot bot commented Sep 15, 2025

🦋 Changeset detected

Latest commit: 82b6b59

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 11 packages
Name Type
react-router Patch
@react-router/architect Patch
@react-router/cloudflare Patch
@react-router/dev Patch
react-router-dom Patch
@react-router/express Patch
@react-router/node Patch
@react-router/serve Patch
@react-router/fs-routes Patch
@react-router/remix-routes-option-adapter Patch
create-react-router Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@brophdawg11 brophdawg11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@brophdawg11 brophdawg11 linked an issue Sep 16, 2025 that may be closed by this pull request
@brophdawg11 brophdawg11 self-assigned this Sep 16, 2025
@brophdawg11 brophdawg11 merged commit 8233930 into remix-run:dev Sep 16, 2025
8 checks passed
@joseph0926 joseph0926 deleted the fix/storage-blocked-navigation branch September 16, 2025 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Crashes when browser storage is blocked
3 participants