4

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)

1 Answer 1

5

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you! I came back to publish the answer since, as you are saying, running the suggested command: npm install @types/vuelidate fixed my issue! Thanks again!
True enough but that guide is several years old and suggests some outdated practices

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.