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.
nuxt/fetch/no-await-inside-custom-wrappersrc/rule-packs/nuxt/rules/nuxt/no-await-inside-custom-wrapper.ts Upstream docs 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.
Recommended fix
Remove await inside custom wrapper, or move it to the Nuxt runtime/API that owns that behavior.
Useful links
Example
Return custom async data wrappers directly
Before
export function useUser() {
return await useFetch('/api/user')
}
After
export function useUser() {
return useFetch('/api/user')
}