Open corymsmith opened 6 years ago
This error happens when someone has this option disabled in Chrome:
I am trying to use a memory storage from local-storage-fallback in the case that people have disabled cookies, etc. but an error is thrown inside mobx-persist when accessing localStorage here: https://github.com/pinqy520/mobx-persist/blob/master/src/index.ts#L41
local-storage-fallback
mobx-persist
localStorage
This is the code I'm using:
const { storage } = require('local-storage-fallback'); const hydrate = create({ storage, jsonify: true }); hydrate('checkout-store', this).then(() => { });
This is the error thrown: Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.
Hey @corymsmith did you ever find a solution for this?
@grantspilsbury
I ended up having to use the following:
const { storage } = require('local-storage-fallback');
This error happens when someone has this option disabled in Chrome:
I am trying to use a memory storage from
local-storage-fallback
in the case that people have disabled cookies, etc. but an error is thrown insidemobx-persist
when accessinglocalStorage
here: https://github.com/pinqy520/mobx-persist/blob/master/src/index.ts#L41This is the code I'm using:
This is the error thrown:
Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document.