Closed ahmad-afiquddin closed 1 year ago
same
Hi, I looked into it, and you should not declare your plugin in the nuxt.config.ts
as specified in the nuxt docs https://nuxt.com/docs/guide/directory-structure/plugins
Just remove it, and Nuxt will find it and the plugin will also work with persistence
Hi, I looked into it, and you should not declare your plugin in the
nuxt.config.ts
as specified in the nuxt docs https://nuxt.com/docs/guide/directory-structure/pluginsJust remove it, and Nuxt will find it and the plugin will also work with persistence
look like it's solved❤
Nice ! Considering it closed ! 🎉
I have the same issue with Nuxt2, do you have a workaround ?
Ok I found the issue. The nuxt plugins are loaded in a alphabetical order.
I believe that your plugin had this information in the official documentation. I think it could be interesting to add it again for Nuxt2 users like myself.
Describe the bug
Trying to use store in a plugin but I found out that states do not persist when a store is used in a plugin with Nuxt 3. When removed from plugin, persist works. Followed nuxt 3 doc to use pinia in plugin nuxt 3 doc
Reproduction
https://stackblitz.com/edit/nuxt-starter-lvetcm?file=plugins%2Fstore.ts,nuxt.config.ts,pages%2Findex.vue,store%2Ftest.ts
System Info
Used Package Manager
npm
Validations