Nuxt · NUXT0020
Call Nuxt composables before await
Flags composable after await in Nuxt context code before it leaks into runtime behavior.
nuxt/context/no-composable-after-awaitsrc/rule-packs/nuxt/rules/nuxt/no-composable-after-await.ts Upstream docs Run this rule
pnpm nuxt doctor --rules nuxt/context/no-composable-after-await
Why it matters
Nuxt gives this pattern a specific contract. Staying inside that contract makes the code easier to test, refactor, and run across server and client runtimes.
Recommended fix
Remove composable after await, or move it to the Nuxt runtime/API that owns that behavior.
Useful links
Example
Call composables before await
Before
export default defineNuxtPlugin(async () => {
await preloadConfig()
const route = useRoute()
})
After
export default defineNuxtPlugin(async () => {
const route = useRoute()
await preloadConfig()
})