fix: pinia store without skipHydrate breaks SSG prerender

This commit is contained in:
AnotiaWang
2025-02-12 11:09:22 +08:00
parent a7e4124620
commit c3c4689d6d
4 changed files with 38 additions and 18 deletions
-1
View File
@@ -26,5 +26,4 @@ export default defineNuxtConfig({
css: ['~/assets/css/main.css'],
compatibilityDate: '2024-11-01',
devtools: { enabled: true },
ssr: false, // FIXME
})
+2 -1
View File
@@ -17,7 +17,7 @@
"@mendable/firecrawl-js": "^1.16.0",
"@nuxt/ui": "3.0.0-alpha.12",
"@nuxtjs/color-mode": "^3.5.2",
"@pinia/nuxt": "^0.9.0",
"@pinia/nuxt": "^0.10.0",
"@tailwindcss/typography": "^0.5.16",
"@tavily/core": "^0.0.3",
"@types/lodash-es": "^4.17.12",
@@ -28,6 +28,7 @@
"marked": "^15.0.7",
"nuxt": "^3.15.4",
"p-limit": "^6.2.0",
"pinia": "^3.0.0",
"tailwindcss": "^4.0.5",
"vue": "latest",
"vue-router": "latest",
+34 -14
View File
@@ -30,8 +30,8 @@ importers:
specifier: ^3.5.2
version: 3.5.2([email protected])
'@pinia/nuxt':
specifier: ^0.9.0
version: 0.9.0([email protected])(pinia@2.3.1([email protected])([email protected]([email protected])))
specifier: ^0.10.0
version: 0.10.0([email protected])(pinia@3.0.0([email protected])([email protected]([email protected])))
'@tailwindcss/typography':
specifier: ^0.5.16
version: 0.5.16([email protected])
@@ -62,6 +62,9 @@ importers:
p-limit:
specifier: ^6.2.0
version: 6.2.0
pinia:
specifier: ^3.0.0
version: 3.0.0([email protected])([email protected]([email protected]))
tailwindcss:
specifier: ^4.0.5
version: 4.0.6
@@ -707,10 +710,10 @@ packages:
resolution: {integrity: sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==}
engines: {node: '>= 10.0.0'}
'@pinia/nuxt@0.9.0':
resolution: {integrity: sha512-2yeRo7LeyCF68AbNeL3xu2h6uw0617RkcsYxmA8DJM0R0PMdz5wQHnc44KeENQxR/Mrq8T910XVT6buosqsjBQ==}
'@pinia/nuxt@0.10.0':
resolution: {integrity: sha512-crYQgsqhEnf0HbOuaLYyLR9hyWK2lYUjcCYhFV4vgo3YThrLdnRKfBLa31au1uqcmgDqoX4mEm2OS3DO8GxR7w==}
peerDependencies:
pinia: ^2.3.0
pinia: ^3.0.0
'@pkgjs/[email protected]':
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
@@ -1120,6 +1123,9 @@ packages:
'@vue/[email protected]':
resolution: {integrity: sha512-sGhTPMuXqZ1rVOk32RylztWkfXTRhuS7vgAKv0zjqk8gbsHkJ7xfFf+jbySxt7tWObEJwyKaHMikV/WGDiQm8g==}
'@vue/[email protected]':
resolution: {integrity: sha512-Cexc8GimowoDkJ6eNelOPdYIzsu2mgNyp0scOQ3tiaYSb9iok6LOESSsJvHaI+ib3joRfqRJNLkHFjhNuWA5dg==}
'@vue/[email protected]':
resolution: {integrity: sha512-8X4roysTwzQ94o7IobjVcOd1aZF5iunikrMrHPI2uUdigZCi2kFTQc7ffYiFiTNaLElCpjOhCnM7bo7aK1yU7A==}
peerDependencies:
@@ -1128,6 +1134,9 @@ packages:
'@vue/[email protected]':
resolution: {integrity: sha512-JhJ8M3sPU+v0P2iZBF2DkdmR9L0dnT5RXJabJqX6o8KtFs3tebdvfoXV2Dm3BFuqeECuMJIfF1aCzSt+WQ4wrw==}
'@vue/[email protected]':
resolution: {integrity: sha512-yhZ4NPnK/tmxGtLNQxmll90jIIXdb2jAhPF76anvn5M/UkZCiLJy28bYgPIACKZ7FCosyKoaope89/RsFJll1w==}
'@vue/[email protected]':
resolution: {integrity: sha512-BtgF7kHq4BHG23Lezc/3W2UhK2ga7a8ohAIAGJMBr4BkxUFzhqntQtCiuL1ijo2ztWnmusymkirgqUrXoQKumA==}
@@ -2876,8 +2885,8 @@ packages:
resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==}
engines: {node: '>=12'}
pinia@2.3.1:
resolution: {integrity: sha512-khUlZSwt9xXCaTbbxFYBKDc/bWAGWJjOgvxETwkTN7KRm66EeT1ZdZj6i2ceh9sP2Pzqsbc704r2yngBrxBVug==}
pinia@3.0.0:
resolution: {integrity: sha512-Go23UsqaeABb4OYNmpDkE9VwDnqmbbjGzWpQhi3xfNkSPO6ZP+Ttt0EMo2J4DHXW+T0l3EqRneeXdyV/oJg/Mg==}
peerDependencies:
typescript: '>=4.4.4'
vue: ^2.7.0 || ^3.5.11
@@ -4950,10 +4959,10 @@ snapshots:
'@parcel/watcher-win32-ia32': 2.5.1
'@parcel/watcher-win32-x64': 2.5.1
'@pinia/nuxt@0.9.0([email protected])(pinia@2.3.1([email protected])([email protected]([email protected])))':
'@pinia/nuxt@0.10.0([email protected])(pinia@3.0.0([email protected])([email protected]([email protected])))':
dependencies:
'@nuxt/kit': 3.15.4([email protected])
pinia: 2.3.1([email protected])([email protected]([email protected]))
pinia: 3.0.0([email protected])([email protected]([email protected]))
transitivePeerDependencies:
- magicast
- supports-color
@@ -5374,6 +5383,10 @@ snapshots:
'@vue/[email protected]': {}
'@vue/[email protected]':
dependencies:
'@vue/devtools-kit': 7.7.1
'@vue/[email protected]([email protected](@types/[email protected])([email protected])([email protected])([email protected])([email protected]))([email protected]([email protected]))':
dependencies:
'@vue/devtools-kit': 7.6.8
@@ -5396,6 +5409,16 @@ snapshots:
speakingurl: 14.0.1
superjson: 2.2.2
'@vue/[email protected]':
dependencies:
'@vue/devtools-shared': 7.7.1
birpc: 0.2.19
hookable: 5.5.3
mitt: 3.0.1
perfect-debounce: 1.0.0
speakingurl: 14.0.1
superjson: 2.2.2
'@vue/[email protected]':
dependencies:
rfdc: 1.4.1
@@ -7284,15 +7307,12 @@ snapshots:
[email protected]: {}
pinia@2.3.1([email protected])([email protected]([email protected])):
pinia@3.0.0([email protected])([email protected]([email protected])):
dependencies:
'@vue/devtools-api': 6.6.4
'@vue/devtools-api': 7.7.1
vue: 3.5.13([email protected])
vue-demi: 0.14.10([email protected]([email protected]))
optionalDependencies:
typescript: 5.7.3
transitivePeerDependencies:
- '@vue/composition-api'
[email protected]:
dependencies:
+2 -2
View File
@@ -1,4 +1,4 @@
import {} from '@pinia/nuxt'
import { skipHydrate } from 'pinia'
export type ConfigAiProvider = 'openai-compatible'
export interface ConfigAi {
@@ -30,5 +30,5 @@ export const useConfigStore = defineStore('config', () => {
},
})
return { config }
return { config: skipHydrate(config) }
})