Nuxt · NUXT0025

Do not await inside custom useFetch/useAsyncData wrappers

Flags await inside custom wrapper in Nuxt fetch code before it leaks into runtime behavior.
NUXT0025vite-doctor/nuxtfetchingerrorSuggestion

Run this rule

pnpm nuxt doctor --rules nuxt/fetch/no-await-inside-custom-wrapper

Why it matters

Nuxt data fetching relies on stable keys, payload serialization, and request context. Bypassing those contracts can duplicate requests or lose SSR data.

Remove await inside custom wrapper, or move it to the Nuxt runtime/API that owns that behavior.

Example

Return custom async data wrappers directly

Before

export function useUser() {
  return await useFetch('/api/user')
}

After

export function useUser() {
  return useFetch('/api/user')
}
Copyright © 2026