ERROR Cannot start nuxt: Context is not availablet

Viewed 252

I'm trying to run the Nuxt3 app but when I'm trying to run npm run dev then this error showing in my console: ERROR Cannot start nuxt: Context is not available

Anyone have face the same type of issue and how to fix that.

2 Answers

I had this same issue but the problem was that I was trying to use Nuxt/Vue specific functionality in a .ts file. I was abstracting some of the lengthier functions and computed objects into a composition file, specifically import { useNuxtApp } from '#imports' and const { $store } = useNuxtApp(). The .ts file has no Nuxt context so these imports and functions just won't work there!

Might you be experiencing something similar?

Related