From ee44ec73092e05fd6994d48e3159bf3996e4ccdc Mon Sep 17 00:00:00 2001 From: Julien Huang Date: Mon, 16 Sep 2024 14:48:45 +0200 Subject: [PATCH] docs: use `defineNuxtComponent` instead of `defineComponent` (#29011) --- docs/2.guide/1.concepts/1.auto-imports.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/2.guide/1.concepts/1.auto-imports.md b/docs/2.guide/1.concepts/1.auto-imports.md index dd7e48fe89..a0b54f7657 100644 --- a/docs/2.guide/1.concepts/1.auto-imports.md +++ b/docs/2.guide/1.concepts/1.auto-imports.md @@ -64,6 +64,10 @@ If you get an error message like `Nuxt instance is unavailable` then it probably Watch a video from Alexander Lichter about handling async code in composables and fixing `Nuxt instance is unavailable` in your app. :: +::tip +When using a composable that requires the Nuxt context inside a non-SFC component, you need to wrap your component with `defineNuxtComponent` instead of `defineComponent` +:: + ::read-more{to="/docs/guide/going-further/experimental-features#asynccontext" icon="i-ph-star-duotone"} Checkout the `asyncContext` experimental feature to use Nuxt composables in async functions. ::