Skip to content
This repository was archived by the owner on Apr 6, 2023. It is now read-only.

Commit 403e0e6

Browse files
authored
fix(nuxt): lazy composables shouldn't block setup in ssr: false (#6901)
1 parent 1700bf8 commit 403e0e6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

packages/nuxt/src/app/composables/asyncData.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,9 +179,9 @@ export function useAsyncData<
179179
if (fetchOnServer && nuxt.isHydrating && key in nuxt.payload.data) {
180180
// 1. Hydration (server: true): no fetch
181181
asyncData.pending.value = false
182-
} else if (instance && nuxt.payload.serverRendered && (nuxt.isHydrating || options.lazy)) {
182+
} else if (instance && ((nuxt.payload.serverRendered && nuxt.isHydrating) || options.lazy)) {
183183
// 2. Initial load (server: false): fetch on mounted
184-
// 3. Navigation (lazy: true): fetch on mounted
184+
// 3. Initial load or navigation (lazy: true): fetch on mounted
185185
instance._nuxtOnBeforeMountCbs.push(initialFetch)
186186
} else {
187187
// 4. Navigation (lazy: false) - or plugin usage: await fetch

0 commit comments

Comments
 (0)