3

I have a project with newest dependencies set up wizth CLI 3. I get error when importing font-picker-vue package in my project (package installs successfully though).

The error: Could not find a declaration file for module 'font-picker-vue'......../node_modules/font-picker-vue/lib/FontPicker.js' implicitly has an 'any' type. Try npm install @types/font-picker-vue if it exists or add a new declaration (.d.ts) file containing declare module font-picker-vue';

Did a google search and one of the solution suggested was to add following code in a *.d.ts file: src

declare module 'vuetify/lib' {
  import 'vuetify/types/lib'
}

Created a *.d.ts file in the root of the proj as shown in below image, hoping that it would work, but it did not:

*.d.ts file in project directory

Next, as suggested SO reply changed import statements to require: const yourModuleName = require('module-name'); and also tried installing from npm install -D @types/font-picker-vue. Both didn't work, @types/font-picker-vue isn't in the npm registry.

I am not sure how to resolve this error. Can somebody help be get this working. Any help is apprecited. Thanks

0

1 Answer 1

1

Create a yourModuleName.d.ts file with the module declaration like this declare module 'vuetify/lib' then try adding this:

"include": "*.d.ts"

To your tsconfig.json file

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

Comments

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.