Closed bdrtsky closed 4 years ago
Looks good to me with the last commit @pi0
Any other pointers?
~After talking with @pi0, we will put this PR in pending
state until the target PR on Nuxt.js will be merged.~
Let's merge with only process.static
check at the moment.
A ctually it won't completely fixes #75 since it will have the hydration error but at least it gives the opportunity in a Nuxt plugin (user side) to change the HTML (thinking of @nuxt/theme) to avoid hydration error
@Atinux so, then probably best not to update module for SSG usage and leave it as is? If so, please close this.
@bdrtsky I think not for theme case but it fixes the bug of overriding with the initial state :+1: so if a state is used for client-only, universal-storage still has partial support. The point with dev
check is that after static-target, users will be at least aware of behavior differences from development time :)
Fixes https://github.com/nuxt-community/universal-storage-module/issues/75
getState
is always returnundefined
in development. And when running in prod in generate mode,getState
returnsinitialState
instead of actual saved local state in cookies or local storage (module ignores cookie or storage sincegetState
return an actual value), which leads to overwriting of local session state.