Skip to content

Crashes when browser storage is blocked #14325

@richardkall

Description

@richardkall

Reproduction

Easiest way to reproduce it is visiting https://reactrouter.com since it has the same issue.

  1. Block all storage in your browser settings (cookies etc.)
  2. Visit reactrouter.com
  3. Navigate to "Docs"
  4. Page breaks with SecurityError: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.

Seems to be linked to scroll restoration, but removing doesn't fix the issue for me. For us this is a real issue in production for users blocking storage in their devices.

System Info

System:
    OS: macOS 15.6.1
    CPU: (10) arm64 Apple M2 Pro
    Memory: 746.00 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.19.0 - ~/.local/state/fnm_multishells/36228_1757592307826/bin/node
    Yarn: 1.22.22 - /opt/homebrew/bin/yarn
    npm: 10.9.3 - ~/.local/state/fnm_multishells/36228_1757592307826/bin/npm
    pnpm: 10.15.1 - /opt/homebrew/bin/pnpm
    bun: 1.2.21 - /opt/homebrew/bin/bun
  Browsers:
    Chrome: 139.0.7258.155
    Edge: 140.0.3485.54
    Safari: 18.6
  npmPackages:
    @react-router/dev: 7.8.2 => 7.8.2 
    @react-router/express: 7.8.2 => 7.8.2 
    @react-router/node: 7.8.2 => 7.8.2 
    react-router: 7.8.2 => 7.8.2 
    vite: 7.1.5 => 7.1.5

Used Package Manager

yarn

Expected Behavior

Page not crashing.

Actual Behavior

Page crashes with an error.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions