diff --git a/packages/nuxt/src/runtime/plugin.vue3.ts b/packages/nuxt/src/runtime/plugin.vue3.ts index 628abc65ad..f15db36457 100644 --- a/packages/nuxt/src/runtime/plugin.vue3.ts +++ b/packages/nuxt/src/runtime/plugin.vue3.ts @@ -1,6 +1,6 @@ import { createPinia, setActivePinia } from 'pinia' import type { Pinia } from 'pinia' -import { defineNuxtPlugin, Plugin } from '#app' +import { defineNuxtPlugin, type Plugin } from '#app' const plugin: Plugin<{ pinia: Pinia }> = defineNuxtPlugin({ name: 'pinia', @@ -12,7 +12,7 @@ const plugin: Plugin<{ pinia: Pinia }> = defineNuxtPlugin({ if (import.meta.server) { nuxtApp.payload.pinia = pinia.state.value } else if (nuxtApp.payload && nuxtApp.payload.pinia) { - pinia.state.value = nuxtApp.payload.pinia + pinia.state.value = nuxtApp.payload.pinia as any } // Inject $pinia