请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

Already included file name

张老师您好,我修改了一下组件名称的大小写,然后再import里修改了对应的大小写,Vetur就报错。我查了一下,这好像是 typescript的老bug了,有什么办法能解决吗?
e.g.

HiMan.vue =>Himan.vue // 名称
-----------------------------
import Himan from './components/Himan.vue'

adamcfranco commented on 6 Jul 2018
Error TS1149: File name ‘C:/Project/frontend/scripts/State.ts’ differs from already included file name ‘…/frontend/scripts/State.ts’ only in casing.

I’ve triple checked the casing in our references and the actual files
have the correct casing as well. As far as I can tell, this is solely
because the relative path uses incorrect casing, or perhaps it’s just
because of the relative path itself?

It compiles just fine on Mac and Linux, but throws this error on
Windows.

正在回答 回答被采纳积分+3

2回答

张轩 2020-10-01 22:12:41

同学你好 这个应该是 vscode 的一个 bug 把,在网上找到相关的解决方法:https://stackoverflow.com/questions/51197940/file-name-differs-from-already-included-file-name-only-in-casing-on-relative-p  你可以试试看。

有一个回答是在 tsconfig 中设置一项

{  
  "compilerOptions": {
    ...    
    "forceConsistentCasingInFileNames": false,
    ...
  }
}


4 回复 有任何疑惑可以回复我~
提问者 Zedof 2020-10-01 09:24:50

最后我修改了项目名,这个vetur的报错bug才消失,我倒,这也太雷人了吧!

0 回复 有任何疑惑可以回复我~
问题已解决,确定采纳
还有疑问,暂不采纳
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号