I'm getting pinia error after build #16269
-
Error: [🍍]: "getActivePinia()" was called but there was no active Pinia. Did you forget to install pinia? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
probably u're calling the store from outside of the setup.: That is warning, that can be or not a problem... if u're implement SSR, that is a problem, if not, probably not.
import { useMyStore } from 'src/stores/my'
defineOptions{{
preFetch ({ store }) {
const myStore = useMyStore(store)
}
}} |
Beta Was this translation helpful? Give feedback.
-
Yes, unfortunately it seems that way. I hadn't encountered any issues with Vuex before, but Pinia is causing problems. Now I'll need to reorganize and find a different solution :( Thanks. |
Beta Was this translation helpful? Give feedback.
probably u're calling the store from outside of the setup.:
https://pinia.vuejs.org/core-concepts/outside-component-usage.html
That is warning, that can be or not a problem... if u're implement SSR, that is a problem, if not, probably not.
preFetch
,boots
,navigation guards
, etc are executed outside of the setup, so u would pass the store if u wanna get ride of that warning: