Error when try to use Pinia's module inside Nuxt plugin #458
-
ProblemI have been trying to run module action to verify if user is logged in by just checking local storage to find bearer token. The thing is that beside of properly pass $pinia from plugin context into modules argument (as it is said in pinia's docs) I receive below error: I defined in nuxt.config.js that this initial-auth plugin should be executed only on client-side Code
Package.json
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
have you checked https://github.com/posva/pinia-example-nuxt for an example? |
Beta Was this translation helpful? Give feedback.
-
It looks to me like your module is installed before pinia's (https://github.com/posva/pinia-example-nuxt/blob/master/nuxt.config.js#L31) |
Beta Was this translation helpful? Give feedback.
-
The updated documentation is now live: https://pinia.esm.dev/ssr/nuxt.html I also added a link to https://composition-api.nuxtjs.org/getting-started/setup/#quick-start as it could change in the future 🙂 |
Beta Was this translation helpful? Give feedback.
The updated documentation is now live: https://pinia.esm.dev/ssr/nuxt.html
I also added a link to https://composition-api.nuxtjs.org/getting-started/setup/#quick-start as it could change in the future 🙂