Nuxt · Data fetching
NUXT0016Use explicit keys for refreshable async data
Finds Nuxt project code that can be written with a clearer framework-supported pattern.
vite-doctor/nuxtfetchingwarnSuggestion
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 async data explicit key for refreshable pattern instead.
Example
Add explicit refresh key
Before
const { data, refresh } = await useFetch('/api/profile')
After
const { data, refresh } = await useFetch('/api/profile', {
key: 'profile',
})
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/async-data-explicit-key-for-refreshable