Nuxt · NUXT0018

Do not register mutating requests as async data

Finds Nuxt project code that can be written with a clearer framework-supported pattern.
NUXT0018vite-doctor/nuxtfetchingerrorSuggestion

Run this rule

pnpm nuxt doctor --rules nuxt/async-data-no-mutation-methods

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.

Use the Nuxt-supported async data no mutation methods pattern instead.

Example

Keep mutations out of useFetch

Before

const { data } = await useFetch('/api/orders', {
  method: 'POST',
  body: { status: 'draft' },
})

After

async function createOrder() {
  return await $fetch('/api/orders', {
    method: 'POST',
    body: { status: 'draft' },
  })
}
Copyright © 2026