Don't need to create the /plugins/persistedstate.ts file. just define '@pinia-plugin-persistedstate/nuxt' in nuxt.config.ts under modules
and then in pinia store file do :
persist: {
storage: localStorage, // you can also choose sessionStorage
pick: [
"persisted state" //it should be inside ""
]
}