Bob Bass
Bob Bass

Reputation: 137

Vetur "Cannot find name 'reactive'" with Nuxt 3 and TypeScript

I use Vue with Vetur every day at work and have my Vetur setup for Vue 3 but I have never actually used TS on the front-end before so I'm unsure if this is a Vetur issue or not.

I'm following along with a Nuxt 3 tutorial and the instructor has the same code verbatim with no issues but my editor is telling me that it doesn't recognize reactive. My understanding is that with Nuxt/Composition API/TypeScript, you shouldn't need to import {reactive} from 'vue'.

If I do import reactive, the options variable appears to be unused as far as the syntax highlighting goes.

The app will compile just fine, but I'm getting the warnings/problems. I sifted through the Vetur options and didn't see anything to address this. I tried adding a Nuxt extension but that didn't seem to help.

The errors are:

💡 Cannot find name 'reactive'.Vetur(2304)
❌ Cannot find name 'reactive'.ts(2304)

Error

Upvotes: 1

Views: 2895

Answers (0)

Related Questions