diff --git a/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts b/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts index 1be3feee..00b577c6 100644 --- a/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts +++ b/packages/vike-vue-pinia/integration/onBeforeRenderClient.ts @@ -11,15 +11,11 @@ function hydratePinia(pageContext: PageContext) { if (!pageContext.isHydration) { return } - const { pinia, fromHtmlRenderer } = pageContext - - const { piniaInitialState } = fromHtmlRenderer - + const { pinia, fromHtmlRenderer: { piniaInitialState } } = pageContext if (!pinia || !piniaInitialState) { // happens if SSR is off return } - // @ts-expect-error TODO: fix type mismatch between Config['fromHtmlRenderer'] set by vike-vue and vike-vue-pinia pinia.state.value = piniaInitialState }