Hey there! I'm currently working on a VueJS application using NuxtJS. Recently, I added an image cropping library called vue-croppie to my project. Following the documentation, I imported the Vue component in the code snippet below:
import VueCroppie from 'vue-croppie'
Unfortunately, an error occurred during the import process which reads:
Could not find a declaration file for module 'vue-croppie'. 'xxx/node_modules/vue-croppie/dist/vue-croppie.cjs.js' implicitly has an 'any' type. Try
if it exists or add a new declaration (.d.ts) file containing `declare module 'vue-croppie';npm i --save-dev @types/vue-croppie
I attempted to create an index.d.ts
file at the root of my project with the declaration content, but unfortunately, it did not resolve the issue. I also tried using require
as suggested in other resources, but that didn't work either.
While I understand this is likely a Typescript-related problem, I don't have much experience with Typescript. Could someone provide more insight into what's happening and how to fix it?
Thanks for your help!