Skip to content

Commit

Permalink
fix(nuxt): await asyncData if ssr: false (nuxt#4791)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored May 6, 2022
1 parent b29f635 commit 87c6251
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/composables/asyncData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ 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.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
instance._nuxtOnBeforeMountCbs.push(initialFetch)
Expand Down

0 comments on commit 87c6251

Please sign in to comment.