Nuxt · Data fetching
NUXT0025Do not await inside custom useFetch/useAsyncData wrappers
Flags await inside custom wrapper in Nuxt fetch code before it leaks into runtime behavior.
vite-doctor/nuxtfetchingerrorSuggestion
Why it happens
Nuxt data fetching relies on stable keys, payload serialization, and request context. Bypassing those contracts can duplicate requests or lose SSR data.
Fix
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')
}
Verify the fix
Run only this rule after editing so the report stays focused on the diagnostic you are closing:
pnpm nuxt doctor --rules nuxt/fetch/no-await-inside-custom-wrapper