在vue项目中遇到如下错误

module "/Users/lin/Documents/web前端/webpack4-learning/webpack-vue/src/components/IsAsyncDemo.vue"
Already included file name '/Users/lin/Documents/web前端/webpack4-learning/webpack-vue/src/components/IsAsyncDemo.vue' differs from file name '/Users/lin/Documents/web前端/webpack4-learning/webpack-vue/src/components/isAsyncDemo.vue' only in casing.
  The file is in the program because:
    Imported via './IsAsyncDemo.vue' from file '/Users/lin/Documents/web前端/webpack4-learning/webpack-vue/src/components/AsyncComponent.vue'
    Root file specified for compilation
    Root file specified for compilationVetur(1261)

在这里插入图片描述
一直在说文件名不同,已经包含的文件名导入文件名不同,为编译的根文件出错,换了一个组件就正常,所以尝试下改了文件名,可以了……

在这里插入图片描述
如果还不行,可以尝试下重启vscode,这个问题通常是 vscode 引起的,一般是你很快的重命名了自己的文件。

Logo

基于 Vue 的企业级 UI 组件库和中后台系统解决方案,为数万开发者服务。

更多推荐