pinia-plugin-persist icon indicating copy to clipboard operation
pinia-plugin-persist copied to clipboard

Persistence doesn't work well when using multiple pinia stores.

Open vannel opened this issue 2 years ago • 5 comments

It works totally fine when there was only ONE pinia store in my application. After I added another pinia definition and it just went weird. It seems that there could be ONLY ONE store that can be persisted into the storage at a time, while others just freeze in the storage, no matter when any actions or $reset being called. And pinia works fine, though. Just the persistence goes wrong.

// authStore.js
const useAuthStore = defineStore("auth", { ... })

// routerStore.js
const useRouterStore = defineStore("router", { ... })

Here are the dependencies in my package.json:

"dependencies": {
   // ......
    "pinia": "^2.0.0-rc.10",
    "pinia-plugin-persist": "^1.0.0",
    "vue": "^3.2.25",
  }

vannel avatar Apr 13 '22 17:04 vannel

I came across the same problem

q807175022 avatar Apr 15 '22 10:04 q807175022

I came across the same problem

L1150143576 avatar Apr 26 '22 08:04 L1150143576

maybe about this https://github.com/Seb-L/pinia-plugin-persist/pull/39

Allen-1998 avatar Apr 29 '22 06:04 Allen-1998

maybe about this https://github.com/Seb-L/pinia-plugin-persist/pull/38

L1150143576 avatar Apr 29 '22 07:04 L1150143576

I came across the same problem too!

Jiangg21 avatar May 10 '22 11:05 Jiangg21