Closed azz0r closed 8 years ago
I am facing this issue too in 1.0.0rc5 .
Hi guys,
@amrit92 Could you provide a little more info? I'm currently using 1.0.0-rc5 in a node environment in combination with LevelUP without issue, but it's a different use case than isomorphic server rendering.
I did notice a mistake in rc5 which will cause an issue if you don't provide a storage argument to persistState
, is that the case in your situation @amrit92?
@azz0r, does the server and client use the exact same store configuration?
Correct me if I'm wrong, but in an isomorphic setting redux-localstorage doesn't actually do anything server-side, so you should in theory be able to leave persistState
out server-side and only add it client side. But perhaps this is easier said than done and requires you to jump through a bunch of awkward loops.
I lack isomorphic experience so if you could share more about your setup or something you think might be relevant that would help!
I think a check for typeof localstorage === 'undefined'
before using localstorage would fix that
I fixed this by condutiobally detecting whether the server or client was calling a store and not including this on the server
It is also a problem when running tests, because localStorage is not defined either.
I'm also having trouble running tests. It would be nice to have an option to pass in an object or something to use as localStorage.
Sorry...I gotta get the other branch
Any work arounds? This doesn't block redux-localstorage working but it leaves an initial error message in console.