]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix: avoid nuxtContext in spa mode (#170)
authorMartin Malinda <malindacz@gmail.com>
Mon, 25 May 2020 12:23:00 +0000 (14:23 +0200)
committerGitHub <noreply@github.com>
Mon, 25 May 2020 12:23:00 +0000 (14:23 +0200)
nuxt/plugin.js

index 4300e7b29b8d41f87b503c7c3b36525a9413b1d7..5da64f9f885d261949efa6a484f6b5f7edb294cf 100644 (file)
@@ -16,7 +16,7 @@ const myPlugin = context => {
     context.beforeNuxtRender(({ nuxtState }) => {
       nuxtState.pinia = getRootState(context.req)
     })
-  } else {
+  } else if (context.nuxtState) {
     setStateProvider(() => context.nuxtState.pinia)
   }
 }