Webpack:“有多个模块,其名称仅在大小写上有所不同".但是引用的模块是相同的 [英] Webpack: "there are multiple modules with names that only differ in casing" but modules referenced are identical

查看:372
本文介绍了Webpack:“有多个模块,其名称仅在大小写上有所不同".但是引用的模块是相同的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用webpack 3.8.1,并且收到以下构建警告的多个实例:

I'm using webpack 3.8.1 and am receiving several instances of the following build warning:

WARNING in ./src/Components/NavBar/MainMenuItemMobile.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:
* /Users/path/to/babel-loader/lib/index.js!/Users/path/to/NavBar/MainMenuItemMobile.js
    Used by 1 module(s), i. e.
    /Users/path/to/babel-loader/lib/index.js!/Users/path/to/NavBar/ConstructedMainMenuItems.js
* /Users/path/to/babel-loader/lib/index.js!/Users/path/to/Navbar/MainMenuItemMobile.js
    Used by 1 module(s), i. e.
    /Users/path/to/babel-loader/lib/index.js!/Users/path/to/Navbar/ConstructedMainMenuItems.js
.....
(webpack)-hot-middleware/client.js ./src/index.js

令人困惑的是,引用的两个"文件只是一个文件-目录中没有两个文件的名称仅以大小写不同.

What's confusing is that the 'two' files referenced are just one file—there are no two files in the directory whose names differ only in case.

我还注意到,如果受这些警告的影响,我的热重装器通常不会提取对文件的更改.

I've also noticed that my hot reloader often doesn't pick up changes to a file if it is affected by these warnings.

什么可能导致此问题?

推荐答案

这通常是微小错字的结果.

This is usually a result of a minuscule typo.

例如,如果要导入import Vue from 'vue'import Vuex from 'vuex'之类的模块.

For instance, if you are importing your modules like import Vue from 'vue', import Vuex from 'vuex'.

浏览文件并检查使用from 'Vue'from 'Vuex'的位置-确保使用与导入语句中完全相同的大写字母(大写字母).

Go through your files and check where you used from 'Vue' or from 'Vuex' - make sure to use the exact same capitals (uppercase letters) as in your import statements.

错误描述应该写得更清楚,但是我解释的是每次导致webpack命令出现此错误的原因.

The error descriptions should have been written more clearly, but what I explained has been the cause of my problem each time for this error on webpack commands.

这篇关于Webpack:“有多个模块,其名称仅在大小写上有所不同".但是引用的模块是相同的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆