Webpack: “there are multiple modules with names that only differ in casing” but modules referenced are identical

后端 未结 23 1040
佛祖请我去吃肉
佛祖请我去吃肉 2020-11-30 02:08

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 a         


        
相关标签:
23条回答
  • 2020-11-30 02:46
    // waring
    import Test from './TestHome'
    // you can rename your file with camel-case and import
    import Test from './test-home'
    // or you should fix the path 
    import Test from '@/views/TestHome'
    

    Hope the two ways will solve your problem。

    0 讨论(0)
  • 2020-11-30 02:47

    This is usually a result of a minuscule typo.

    For instance, if you are importing your modules like import Vue from 'vue', import Vuex 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.

    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.

    0 讨论(0)
  • 2020-11-30 02:49

    Similar issue, but my problem was packages installed in C:\Users\<username>\AppData\Local\Yarn. Deleting that folder and re-adding the global packages I wanted fixed the issue.

    0 讨论(0)
  • 2020-11-30 02:50

    It happened to me on angular 6. It's capital and small letter misusage error which your ide or text editor may ignore. I USED

    import { PayComponent }      from './payment/pay/pay.component';
    

    INSTEAD OF

    import { PayComponent }      from './Payment/pay/pay.component';
    

    IMAGINE JUST "P" and "p". Goodluck.

    0 讨论(0)
  • 2020-11-30 02:52

    The case of the letter drive also matter. In my case, Windows 10 had the upper case 'C' while I had lower case 'c' in the file.

    0 讨论(0)
  • 2020-11-30 02:54

    I had the same issue in angular 6 project.

    This issue occurred because while importing component in the module like

    import { ManageExamComponent } from './manage-Exam.component'; 
    

    I have written like manage-Exam where Exam is in capital letter and webpack understand small letter.

    As soon as i used

    import { ManageExamComponent } from './manage-exam.component'; 
    

    used exam in small and issue resolved.

    0 讨论(0)
提交回复
热议问题