prazdevs / pinia-plugin-persistedstate

💾 Configurable persistence and rehydration of Pinia stores.
https://prazdevs.github.io/pinia-plugin-persistedstate/
MIT License
2.05k stars 118 forks source link

why i can't import in nuxt3 #317

Closed Golong-me closed 1 month ago

Golong-me commented 2 months ago

Describe the bug

config

export default defineNuxtConfig({
    modules: [
        '@pinia/nuxt', 
        '@pinia-plugin-persistedstate/nuxt',
    ],
})

1

Reproduction

see describe

System Info

"dependencies": {
    "nuxt": "^3.12.2",
    "pinia": "^2.1.7",
    "vue": "latest"
  }, 

"devDependencies": {
    "@element-plus/nuxt": "^1.0.9",
    "@pinia-plugin-persistedstate/nuxt": "^1.2.1",
    "@pinia/nuxt": "^0.5.1",
    "element-plus": "^2.7.6",
    "sass": "^1.77.6"
  }

Used Package Manager

npm

Validations

prazdevs commented 1 month ago

these imports are auto-imports from Nuxt and imported from #imports .

also, if you need further investigation please provide a proper reproduction repo 🫡

Golong-me commented 1 month ago

i fix it you neet add this code in nuxt

export default defineNuxtConfig({
  modules: ['@pinia/nuxt', '@pinia-plugin-persistedstate/nuxt'],
  build: {
    transpile: ['pinia-plugin-persistedstate'],
  },
});