Back to Nuxt

NUXT_E1001

docs/errors/e1001.md

4.5.2578 B
Original Source

E1001

A composable that needs the Nuxt instance (useNuxtApp(), useRoute(), useFetch(), …) ran outside a plugin, Nuxt hook, route middleware, or Vue setup(). The most common trigger is calling it inside an async callback (setTimeout, .then(), after an await) where the context has been lost.

Resolution

Call the composable synchronously at the top of setup() / a plugin / middleware and reuse the captured result later. For server-side async work, wrap the call with nuxtApp.runWithContext().

::read-more{to="/docs/getting-started/error-handling"} ::