isomorphic support: localStorage is not defined
See original GitHub issueFailed to retrieve initialize state from localStorage: ReferenceError: localStorage is not defined
at /Users/azz0r/Sites/mobile-presales/node_modules/redux-localstorage/lib/persistState.js:59:38
at /Users/azz0r/Sites/mobile-presales/node_modules/redux/lib/applyMiddleware.js:38:19
at createStore (/Users/azz0r/Sites/mobile-presales/node_modules/redux/lib/createStore.js:59:33)
Any work arounds? This doesn’t block redux-localstorage working but it leaves an initial error message in console.
Issue Analytics
- State:
- Created 7 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
How to avoid getting error 'localStorage is not defined' on ...
Show activity on this post. I was using localStorage in my webApp to store data on client side. But when I've tried to...
Read more >Handle localStorage if not defined (isomorphic) · Issue #13
The straightforward fix, I think, is to remove 'const defaultStorage = adapter(localStorage);' at the top of persistState.js and replace the ...
Read more >How to avoid getting error 'localStorage is not defined' on ...
Coding example for the question How to avoid getting error 'localStorage is not defined' on server in ReactJS isomorphic app?-Reactjs.
Read more >Node.js – How to avoid getting error 'localStorage is not ...
I was using localStorage in my webApp to store data on client side. But when I've tried to make the app isomorphic, this...
Read more >Server Error: ReferenceError: (localstorage) is not defined
( Question in stackoverflow ). I have a category name stored in my localstorage. I understand that with nextjs, localstorage is only stored ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is also a problem when running tests, because localStorage is not defined either.
I think a check for
typeof localstorage === 'undefined'
before using localstorage would fix that