Vue3+TypeScript应用报错提示Could not find a declaration file for module

Vue3+TypeScript应用报错提示Could not find a declaration file for module
在学习Vue3+TypeScript过程中遇到错误提示:Could not find a declaration file for module...

1、错误提示:Could not find a declaration file for module ‘./App.vue’. ‘xxx/App.vue.js’ implicitly has an ‘any’ type.

解决办法:
在tsconfig.json文件中添加配置 "noImplicitAny": false项,如图:

2、错误提示:SyntaxError: Cannot use import statement outside a module
解决办法:在package.json中添加"type":"module",如图:

the end

热门文章