There are multiple modules with names that only differ in casing.

報錯信息如下

WARNING in ./src/__BASE__/components/ScrollView.vue
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* /Users/zhen/2dfire/myprojects/static-ymir/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/zhen/2dfire/myprojects/static-ymir/node_modules/eslint-loader/index.js??ref--0!/Users/zhen/2dfire/myprojects/static-ymir/src/__BASE__/components/ScrollView.vue
    Used by 1 module(s), i. e.
    /Users/zhen/2dfire/myprojects/static-ymir/node_modules/ts-loader/index.js??ref--2!/Users/zhen/2dfire/myprojects/static-ymir/node_modules/tslint-loader/index.js!/Users/zhen/2dfire/myprojects/static-ymir/src/activity/main.ts
* /Users/zhen/2dfire/myprojects/static-ymir/node_modules/vue-loader/lib/index.js??vue-loader-options!/Users/zhen/2dfire/myprojects/static-ymir/node_modules/eslint-loader/index.js??ref--0!/Users/zhen/2dfire/myprojects/static-ymir/src/__BASE__/components/scrollView.vue
    Used by 2 module(s), i. e.
    .......

這是在引用組件時路徑大小寫不對造成的。
上面報錯問題如下:
ScrollView.vue在components下的文件名叫scrollView.vue
錯誤引用:

import ScrollView from '../__BASE__/components/ScrollView.vue'

正確使用:

import ScrollView from '../__BASE__/components/scrollView.vue'
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章