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 (#6901
Browse files Browse the repository at this point in the history
)
  • Loading branch information
danielroe authored Aug 24, 2022
1 parent 1700bf8 commit 403e0e6
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 403e0e6

Please sign in to comment.