-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Uncaught DOMException when in an environment without access to sessionStorage #3659
Comments
I'm getting this error as well. |
I'm also receiving this error.
|
We're having the same issue at https://github.com/webstudio-is . This happens when a Remix website is in an iframe with a domain different from the main document, and "Block third-party cookies" is enabled at |
Since Remix 1.10.0, the component is the one from React Router. Its implementation changed a bit, and the only calls to sessionStorage are within the component, removing the component like OP tried should work fine. |
@machour is correct and this should no longer be an issue once you remove the component |
What version of Remix are you using?
1.6.3
Steps to Reproduce
Establish an environment where the application does not have access to sessionStorage, such as using a Remix app in a child iframe with a different origin from the parent while the user is using Chrome in Incognito mode with third party cookies blocked.
Visit any route within the Remix app and receive
Uncaught DOMException: Failed to read the 'sessionStorage' property from 'Window': Access is denied for this document.
Expected Behavior
I would expect the app to load, even without access to sessionStorage. Functionality provided by a component dependent on sessionStorage (ScrollRestoraion) may not function correctly, but the application should not throw an unhandled exception.
Placing access to sessionStorage inside a try/catch block appears to allow the application to continue to function. See
remix/packages/react/scroll-restoration.tsx
lines 11-14.I attempted not using the ScrollRestoration component, but the exception still occurs.
Actual Behavior
Visiting any route in the above environment causes an Uncaught DOMException to be thrown and the application fails to render.
The text was updated successfully, but these errors were encountered: