Using 2 stores inside vue component in Options API (getActivePinia was called with no active Pinia error) #1900
-
Hello, I have issue I cannot find solution for. I have following component:
As you can see I want to use 2 pinia stores inside it
But if I do, then I get the following error:
It works just fine if I use only 1 store. I found in official example here: https://stackblitz.com/github/piniajs/example-vue-3-vite?file=src%2Fstores%2Fuser.ts, that with Composition API it works just fine.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I have figured it out. I was using another What helped me figure it out is this: #664 (comment) So in example:
To fix this I have to remove global
I dislike this approach, as I think having one object to control this is much better, but it is what it is. |
Beta Was this translation helpful? Give feedback.
I have figured it out. I was using another
alert.ts
store inside myauthentication.ts
store, but globally.What helped me figure it out is this: #664 (comment)
So in example: