redux-persist-node-storage
redux-persist-node-storage copied to clipboard
fs.statSync is not a function
I installed redux-persist-node-storage and use the example, but a have problem: TypeError: fs.statSync is not a function
LocalStorage.prototype._init = function() { var _MetaKey, _decodedKey, _keys, e, error, error1, i, index, k, len, stat; try { stat = fs.statSync(this._location); //the problem if ((stat != null) && !stat.isDirectory()) { throw new Error("A file exists at the location '" + this._location + "' when trying to create/open localStorage"); } ...
fs
is not a dependency of redux-persist-node-storage
. Is it possible there's an issue with how you're importing fs
?
I'm getting the same error - it appears to be an issue with the LocalStorage
import at https://github.com/pellejacobs/redux-persist-node-storage/blob/36c0ae5ff805779d094927f67adf5befef1367ab/src/index.ts#L1.
I can see the errored code block at https://github.com/lmaccherone/node-localstorage/blob/3f58430a8847172ada6d097fb162420fd143d08e/LocalStorage.coffee#L97 at a later version.