-
-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nuxt3 bulid error #32
Comments
But this will not affect its normal operation. There is data in the |
If I rename the |
Mmh, indeed, I didn't get this error before. If anyone has an idea, feel free to help. 🥺 |
Ok, with the latest plugins/persistedstate.tsimport { createPersistedState } from 'pinia-plugin-persistedstate'
import { defineNuxtPlugin, useCookie } from '#app'
export default defineNuxtPlugin(nuxtApp => {
nuxtApp.$pinia.use(createPersistedState({
storage: {
getItem: key => {
return useCookie(key, { encode: (x: any) => x, decode: (x: any) => x })
.value
},
setItem: (key, value) => {
useCookie(key, { encode: (x: any) => x, decode: (x: any) => x }).value =
value
},
},
}))
}) stores/user.tsimport { defineStore } from 'pinia'
export const useUserStore = defineStore('user', {
state: () => ({
username: 'PraZ',
}),
persist: true
}) @waset tell me if that fixes it for you as well, and I will update the Nuxt usage docs anyways. I may work later on a |
Feel free to reopen if you still encounter an issue (with 1.5.0 once released) |
It's so cool that it can be |
and in Browser:
![image](https://user-images.githubusercontent.com/55943270/156705872-6ef3d0b7-5051-497a-918b-75e3d3ca4da1.png)
package.json
nuxt.config.ts
plugins/pinia-persist.ts
composables/useUser.ts
The text was updated successfully, but these errors were encountered: