一、报错提示
vue3+ts项目打包报Elementui内部的错
ERROR in D:/Project/项目名称/node_modules/element-ui/types/index.d.ts(1,15):
1:15 Cannot find module './element-ui' or its corresponding type declarations.
> 1 | export * from './element-ui'
| ^
2 |
3 | import * as ElementUI from './element-ui'
4 | export default ElementUI
ERROR in D:/Project/项目名称/node_modules/element-ui/types/index.d.ts(3,28):
3:28 Cannot find module './element-ui' or its corresponding type declarations.
1 | export * from './element-ui'
2 |
> 3 | import * as ElementUI from './element-ui'
| ^
4 | export default ElementUI
5 |
二、解决方案
在tsconfig.json文件,compilerOptions里加入 “skipLibCheck”: true,
翻译为:跳过检查库的代码。文章来源:https://www.toymoban.com/news/detail-506307.html
文章来源地址https://www.toymoban.com/news/detail-506307.html
到了这里,关于【异常】解决 Cannot find module ‘./element-ui‘ or its corresponding type declarations.的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!