nuxt 3 A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function
Asked Answered
E

0

6

I want to make asynchronous composables with useFetch(), $fetch and asyncDataFetch() but there is a constant error, which says:

Error: [nuxt] A composable that requires access to the Nuxt instance was called outside of a plugin, Nuxt hook, Nuxt middleware, or Vue setup function

I want to use nuxt instances outside setup...

But I don't know how to do that, I heard about useNuxtApp() but I didn't quite understand...

Engaging answered 15/6, 2023 at 16:19 Comment(1)
Can you share the code on the composables you want to create?Flyblown

© 2022 - 2024 — McMap. All rights reserved.