Need help with setting up store for Nuxt Client & Server (API) #2660
Unanswered
rohitasare7
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
My requirement -->
I have been trying to use Pinia but I am getting error --> [🍍]: "getActivePinia()" was called but there was no active Pinia. Are you trying to use a store before calling "app.use(pinia)"? See https://pinia.vuejs.org/core-concepts/outside-component-usage.html for help. This will fail in production.
As per documentation -->
I am not able to use asyncData and get reference for $pinia
import { useStore } from '~/stores/myStore'
export default {
asyncData({ $pinia }) {
const store = useStore($pinia)
},
}
any help is appreciated :)
Beta Was this translation helpful? Give feedback.
All reactions