xyxiao001 / vue-cropper

A simple picture clipping plugin for vue
https://github.xyxiao.cn/vue-cropper/docs/vue3.html
MIT License
4.31k stars 700 forks source link

npm run build 报错,提示Could not find a declaration file for module './vue-cropper.vue'. #696

Open svscon opened 1 year ago

svscon commented 1 year ago

我创建了一个空的vue3+vite应用, npm run dev一切正常。npm run build的时候报错如下:

test@0.0.0 type-check vue-tsc --noEmit node_modules/vue-cropper/lib/index.ts:1:24 - error TS7016: Could not find a declaration file for module './vue-cropper.vue'. 'E:/test/node_modules/vue-cropper/lib/vue-cropper.vue.js' implicitly has an 'any' type. 1 import VueCropper from './vue-cropper.vue'


Found 1 error in node_modules/vue-cropper/lib/index.ts:1
xyxiao001 commented 1 year ago

这应该是 ts 的报错

EDSpower commented 1 year ago

遇到同样的问题

jerryyan1990 commented 1 year ago

+1 要怎么解决啊?

xyxiao001 commented 1 year ago

在 shims-vue.d.ts 文件里添加

declare module 'vue-cropper' 看看

EDSpower commented 1 year ago

在tsconfig.json加上 "allowJs": true, "noImplicitAny": false,