-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fallback if localStorage
is not available.
#41
Comments
I look into the code and as I see you did something like that. svelte-persistent-store/src/core.ts Lines 286 to 292 in 584b57b
Maybe it's a svelte-kit issue then ? |
I never encountered this case before.
It's not an issue with SvelteKit, the issue came from the |
Well, shame on me, but i forgot to mention that this issue occurs only on incognito mode, otherwise working perfectly. |
I just push the version |
I've tested it, working like a charm. Thank you for the super fast reply and fix! |
Hello there!
I met a quite edge case issue while using the package.
In chrome, if you have an embed
iframe
on a site (which uses this package), and you open it inincognito mode
it will be throws an error.Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
I walked around the issue, so it's a chrome specific issue which is exists on both mobile and desktop (tested on win, ubuntu, android),
I tried to handle on the the lacking of
localStorage
in a+page.ts
load
and throwing the user to a meaningful error page, but files are loaded by the browser when the document load starts and it's try to "connect" to thelocalStorage
instantly and unfortunately it's kill the app before it can be handled by a svelte-kitload
function.I thought about a fallback option or something like that. I mean if it can't read the
localStorage
, drop a meaningful error but make a regular store regardless to prevent app breaks.The title probably not too precise, so modify freely.
Best regards.
The text was updated successfully, but these errors were encountered: