Skip to content

vue-doctor/correctness/no-async-setup-without-suspense ​

Wrap the async component in <Suspense> with a fallback, or move the awaited work into onMounted() or a composable

PropertyValue
CategoryCorrectness
Default Severitywarning
Confidencemedium
FixableNo
Engineoxlint
Sincev1.0.0
Frameworksvue, nuxt
Test filesNot checked (which files)

Why it matters ​

Wrap the async component in <Suspense> with a fallback, or move the awaited work into onMounted() or a composable

How to fix ​

Review the finding and update the code according to best practices below.

Agent Guidance ​

A top-level await in <script setup> (or an async setup()) makes the component async. Ensure a parent renders it inside <Suspense> with a fallback, or move the awaited work into onMounted or a composable. In Nuxt, app.vue, error.vue, pages and layouts are not reported: Nuxt renders them inside <Suspense>.


Rule source: vue-doctor/correctness/no-async-setup-without-suspense

Released under the MIT License.