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

Commit

Permalink
fix(nuxt): lazy composables shouldn't block setup in ssr: false
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Aug 24, 2022
1 parent 856c2a6 commit 5ccd397
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/nuxt/src/app/composables/asyncData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ export function useAsyncData<
if (fetchOnServer && nuxt.isHydrating && key in nuxt.payload.data) {
// 1. Hydration (server: true): no fetch
asyncData.pending.value = false
} else if (instance && nuxt.payload.serverRendered && (nuxt.isHydrating || options.lazy)) {
} else if (instance && ((nuxt.payload.serverRendered && nuxt.isHydrating) || options.lazy)) {
// 2. Initial load (server: false): fetch on mounted
// 3. Navigation (lazy: true): fetch on mounted
// 3. Initial load or navigation (lazy: true): fetch on mounted
instance._nuxtOnBeforeMountCbs.push(initialFetch)
} else {
// 4. Navigation (lazy: false) - or plugin usage: await fetch
Expand Down

0 comments on commit 5ccd397

Please sign in to comment.