Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Could not find a declaration file for module 'vuelidate'

In Vuejs, while following the Vuelidate installation instructions (https://vuelidate.js.org/#getting-started), I get a warning at:

import Vuelidate from 'vuelidate'

The warning says:

Could not find a declaration file for module 'vuelidate'. 'c:/Users/[myUser]/../../index.js' implicitly has an 'any' type. Try npm install @types/vuelidate if it exists or add a new declaration (.d.ts) file containing declare module 'vuelidate';ts(7016)

like image 414
Juan C. Gonzalez Avatar asked Oct 18 '25 15:10

Juan C. Gonzalez


1 Answers

it appears you are using typescript, and thus Vue requires a type declaration file for all Vuelidate methods and properties. If you run npm install @types/vuelidate as suggested, the error should go away.

In the future, if you are working with an npm module that has not published types through npm, you will have to write the declaration file yourself, but don't worry about it for now.

like image 157
LShapz Avatar answered Oct 21 '25 08:10

LShapz