From 00e60436017f4d2bc00a7e3445a348719c03ceff Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 29 Nov 2021 11:22:38 +0000 Subject: [PATCH] refactor(nuxt3): don't include null errors in payload (#2153) --- packages/nuxt3/src/app/composables/asyncData.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/nuxt3/src/app/composables/asyncData.ts b/packages/nuxt3/src/app/composables/asyncData.ts index 83292ac3ce..5482c9b564 100644 --- a/packages/nuxt3/src/app/composables/asyncData.ts +++ b/packages/nuxt3/src/app/composables/asyncData.ts @@ -104,7 +104,9 @@ export function useAsyncData< .finally(() => { asyncData.pending.value = false nuxt.payload.data[key] = asyncData.data.value - nuxt.payload._errors[key] = !!asyncData.error.value + if (asyncData.error.value) { + nuxt.payload._errors[key] = true + } delete nuxt._asyncDataPromises[key] }) return nuxt._asyncDataPromises[key]