Skip to content

I'm getting pinia error after build #16269

Discussion options

You must be logged in to vote

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:

import { useMyStore } from 'src/stores/my'
defineOptions{{
  preFetch ({ store }) {
    const myStore = useMyStore(store)
  }
}}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Answer selected by GokhanKR
Comment options

You must be logged in to vote
1 reply
@TobyMosque
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants