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:

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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With