robinvdvleuten / vuex-persistedstate

💾 Persist and rehydrate your Vuex state between page reloads.
https://npm.im/vuex-persistedstate
MIT License
5.76k stars 375 forks source link

Unable to access data from Vuex after rehydration in Nuxt.js #439

Closed vishytk closed 2 years ago

vishytk commented 2 years ago

Setup:

nuxt 2.15.7: vuex-persistedstate 4.1.0: node 16.13.1: yarn 1.22.15:

plugins/persistedstate.js

import createPersistedState from 'vuex-persistedstate'

export default ({ store }) => {
  createPersistedState({
    key: 'applocal',
    storage: window.localStorage,
    overwrite: true,
  })(store)
}

When I reload the page data is restored from localStore to Vuex. But I am unable to access the data from the page. I have tried accessing the data from Nuxt lifehooks.

I have tried this both in ssr and spa modes and the result is the same.

vishytk commented 2 years ago

Anyone ? please help.

robinvdvleuten commented 2 years ago

Please ask question on either StackOverflow or the VueJS forum, this is for issues only.