Closed muratgozel closed 7 years ago
Hm, can you log out the actual error
i.e. replace the console.warn with console.warn('Error in storage.getAllKeys', err);
Yes.
localforage.js:694 Uncaught (in promise) TypeError: Cannot read property 'name' of null(…)
localforage.js:694:
...
// Specialize the default `ready()` function by making it dependent
// on the current database operations. Thus, the driver will be actually
// ready when it's been initialized (default) *and* there are no pending
// operations on the database (initiated by some other instances).
function _fullyReady(callback) {
var self = this;
var promise = self._initReady().then(function () {
/* LINE 694 */ var dbContext = dbContexts[self._dbInfo.name];
if (dbContext && dbContext.dbReady) {
return dbContext.dbReady;
}
});
promise.then(callback, callback);
return promise;
}
...
It says _dbInfo has no name property. So i also log the self object:
It looks like _dbInfo is null.
Did you figure this one out? I have the same problem, but only in Safari. It breaks my whole app though.
@omichelsen @muratgozel sounds like an upstream localForage issue? localForage is great, but if needed you can always switch back to the asyncLocalStorage
provided by redux-persist
I have restructured my module by removing getStoredState function. The problem was occur in all browsers for me.
I'm using
persistStore
andgetStoredState
functions at different locations in my app.persistStore
comes after redux'screateStore
function (as usual):And
getStoredState
called by the root component of my app. (InsidecomponentDidMount
) :My redux persist configuration has only 2 args which are
whitelist
andstorage
:When i build the app, i receive an error that says
getStoredState.js:43 Error in storage.getAllKeys
If i remove the localForage from the options, everything works fine. Removing getStoredState function from my root component is also fine.
getStoredState.js:43