2017-11-28 4 views
1

のWebPACK:「そこだけ筐体に異なる名前を持つ複数のモジュールがある」が、参照モジュールが同一であり、私はWebPACKの3.8.1を使用していますし、次のビルド警告のいくつかのインスタンス受け付けております

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 

は何を混乱させるのは、参照される2つのファイルが1つのファイルであることです。ディレクトリには、大文字と小文字の区別だけが異なる2つのファイルはありません。

また、ホットリロードでは、これらの警告の影響を受けると、ファイルの変更を取得しないことがよくあります。

この問題の原因は何ですか?

答えて

3

これは、通常、非常に小さな誤植の結果です。

import Vue from 'vue'のようなモジュールをインポートする場合は、import Vuex from 'vuex'です。

はあなたのファイルを通過し、あなたがfrom 'Vue'またはfrom 'Vuex'エラーの説明がより明確に書かれているはず

を使用した場合チェックしますが、私が説明することはWebPACKのコマンドでこのエラーのたびに私の問題の原因となっていました。

+0

あなたはそうです、それはモジュール名ではなくパス名であり、それが私を投げ捨てました。私は 'NavBar/MainMenuItemMobile.js'を持っていました.Navbarの 'b'は小文字だったはずです。 – adc17

関連する問題