In index.js, createState() is called first (and plugins are initialized), then the server state is restored.
This effectively disables plugins using Local Storage to persist state (client side data is overriden with SSR data every time). A brief code example is attached below for easier understanding.
I propose to inject a SSR restore plugin at the first of Vuex plugins
constructor parameter. This way, SSR restore happens before other plugins.
Code:
import createPersistedState from 'vuex-persistedstate'
export const state = () => ({
// ... defaults ...
})
export const plugins = [
createPersistedState()
]
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c841">#c841</a>)</em></sub></div>