Nuxt · NUXT0026

Use Nuxt data fetching primitives for SSR render data

Flags raw fetch in setup in Nuxt fetch code before it leaks into runtime behavior.
NUXT0026vite-doctor/nuxtfetchingwarnNo fix

Run this rule

pnpm nuxt doctor --rules nuxt/fetch/no-raw-fetch-in-setup

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.

Remove raw fetch in setup, or move it to the Nuxt runtime/API that owns that behavior.

Example

Use Nuxt data fetching in setup

Before

<script setup lang="ts">
const data = await $fetch('/api/user')
</script>

After

<script setup lang="ts">
const { data } = await useFetch('/api/user')
</script>
Copyright © 2026