diff --git a/src/ssrPlugin.ts b/src/ssrPlugin.ts index ea01adf1a1..b45c0cc188 100644 --- a/src/ssrPlugin.ts +++ b/src/ssrPlugin.ts @@ -20,7 +20,7 @@ export const PiniaSsr = (vue: VueConstructor) => { // @ts-ignore this.$options.setup = (props: any, context: SetupContext) => { // @ts-ignore - setActiveReq(context.ssrContext.req) + if (context.ssrContext) setActiveReq(context.ssrContext.req) return setup(props, context) } }