Nuxt · Data fetching

NUXT0027Prefer Nuxt data factories for custom data composables

Finds Nuxt fetch code that should use the supported create use fetch pattern instead.

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

Use the Nuxt-supported create use fetch pattern instead.

Example

Use create use fetch

Before

export function useOrders() {
  return useFetch('/api/orders')
}

After

export const useOrders = createUseFetch('/api/orders')

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/prefer-create-use-fetch
Copyright © 2026