Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Local storage value not being set in Nuxt using the latest version of vuex-persistedstate 3.1.0 #369

Open
ricardoaat opened this issue Nov 25, 2020 · 1 comment

Comments

@ricardoaat
Copy link

  • vuex-persistedstate version: 3.1.0
  • node version: v12.18.3
  • npm (or yarn) version: 6.14.6

Relevant code or config

import createPersistedState from 'vuex-persistedstate'

export default ({ store }) => {
  createPersistedState({
    key: 'lekey',
    paths: [],
    storage: {
      getItem: key => localStorage.getItem(key),
      setItem: (key, value) => localStorage.setItem(key, value),
      removeItem: key => localStorage.removeItem(key)
    }
  })(store)
}

What you did: Used the library with Nuxt with a very simple configuration that works on another of my projects.

What happened: When using the latest version the value in the local storage is always empty {} but when I downgrade to version ^2.7.1 it works perfectly. (The value in the local storage is populated with the store.

@kicaal
Copy link

kicaal commented Dec 1, 2020

You must include the names of the store modules in paths

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants