在写vue项目的时候

当我使用 :

import dataSource from '../overseaProduct/house/dataSource';

引入dataSource文件的时候:控制台报如下警告:

client?e46d:147 ./src/views/overseaProduct/house/dataSource.js
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:
* F:\jrtfWork\OA\node_modules\happypack\loader.js?id=happybabel!F:\jrtfWork\OA\src\views\overseaProduct\house\dataSource.js
    Used by 1 module(s), i. e.
    F:\jrtfWork\OA\node_modules\babel-loader\lib\index.js!F:\jrtfWork\OA\node_modules\vue-loader\lib\selector.js?type=script&index=0!F:\jrtfWork\OA\src\views\performance\person.vue
* F:\jrtfWork\OA\node_modules\happypack\loader.js?id=happybabel!F:\jrtfWork\OA\src\views\overseaProduct\house\datasource.js
    Used by 5 module(s), i. e.
    F:\jrtfWork\OA\node_modules\babel-loader\lib\index.js!F:\jrtfWork\OA\node_modules\vue-loader\lib\selector.js?type=script&index=0!F:\jrtfWork\OA\src\views\overseaProduct\house\yuyueDetails.vue
 @ ./src/views/overseaProduct/house/dataSource.js
 @ ./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/selector.js?type=script&index=0!./src/views/performance/person.vue
 @ ./src/views/performance/person.vue
 @ ./src/router/router.js
 @ ./src/main.js
 @ multi (webpack)-dev-server/client?http://192.168.1.198:8080 webpack/hot/dev-server @/main

 大致意思为:有多个模块的名称只在外壳中不同。

 这可能导致在具有其他大小写语义的文件系统上编译时出现意想不到的行为。
 
经过一段时间这折腾发现项目中 在其他目录下也有一个重名的
dataSource.js文件:
在项目中全局搜索:
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

 

 改掉其中一个文件名就不会报这个警告了。

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

 

 现在控制台就没有警告了。

 

附:在网上搜索错误解决方案时,发现当我们把  要引入的 文件名大小写, 写错时也会出现这样的警告。

如果OrgTree组件是大写的,那么这样用会错:

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

 

详见:

https://blog.csdn.net/qq_40887780/article/details/91480094

https://blog.csdn.net/weixin_41111068/article/details/84870341

https://www.bbsmax.com/A/RnJWwlprJq/

相关文章:

  • 2021-07-25
  • 2021-10-09
  • 2021-10-08
  • 2021-10-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-28
  • 2022-12-23
  • 2021-11-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案