diff --git a/packages/nuxt/src/app/composables/asyncData.ts b/packages/nuxt/src/app/composables/asyncData.ts index 8ca773a338..4808d4d6c8 100644 --- a/packages/nuxt/src/app/composables/asyncData.ts +++ b/packages/nuxt/src/app/composables/asyncData.ts @@ -311,6 +311,11 @@ export function useAsyncData< result = pick(result as any, options.pick) as DataT } + if (import.meta.dev && import.meta.server && !result) { + // @ts-expect-error private property + console.warn(`[nuxt] \`${options._functionName || 'useAsyncData'}\` should return a value that is not \`null\` or \`undefined\` or the request may be duplicated on the client side.`) + } + nuxtApp.payload.data[key] = result asyncData.data.value = result