Skip to content

"There are multiple modules with names that only differ in casing" #926

Closed

Description

@dyh333

i cloned one project to local and npm install, npm start. but found below warning.
my dev environment is in windows 10 system

WARNING in (webpack)/buildin/module.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:

  • E:\GitHub\angular2-webpack-starter\node_modules\webpack\buildin\module.js
    Used by 2 module(s), i. e.
    E:\GitHub\angular2-webpack-starter\node_modules\punycode\punycode.js
  • e:\GitHub\angular2-webpack-starter\node_modules\webpack\buildin\module.js
    Used by 1 module(s), i. e.
    e:\GitHub\angular2-webpack-starter\node_modules\rxjs\util\root.js

Activity

  1. inska commented on Sep 1, 2016

    @inska

    Same here

  2. junyun0516 commented on Sep 5, 2016

    @junyun0516

    me too ㅠㅠ

  3. Junik commented on Sep 7, 2016

    @Junik

    If u use VS Code try change path to project from
    c:[path to angular2-webpack-starter]
    to
    C:[path to angular2-webpack-starter]

    in @dyh333 case fix:
    e:\GitHub\angular2-webpack-starter> cd E:\GitHub\angular2-webpack-starter
    npm start
    in your terminal or cli

  4. PatrickJS commented on Sep 9, 2016

    @PatrickJS
    Owner

    /\ this is an OS (windows) problem. Please see the solution above via @Junik

  5. alvipeo commented on Sep 9, 2016

    @alvipeo

    @gdi2290 well, there are lots of us...

  6. PatrickJS commented on Sep 9, 2016

    @PatrickJS
    Owner

    this is a problem with node.js and windows so I can't do anything about it. you just need to make sure you cd with the correct path

  7. aminebizid commented on Sep 9, 2016

    @aminebizid

    On Windows, stop naming files with upper case. Here we use kebab case

  8. luchillo17 commented on Sep 13, 2016

    @luchillo17

    I'm having almost the same warning except it's in Mac:

    WARNING in ./~/rxjs/add/operator/map.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/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/string-replace-loader/index.js?{"search":"var sourceMappingUrl = extractSourceMappingUrl\\(cssText\\);","replace":"var sourceMappingUrl = \"\";","flags":"g"}!/Users/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/Rxjs/add/operator/map.js
        Used by 1 module(s), i. e.
        /Users/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/string-replace-loader/index.js?{"search":"var sourceMappingUrl = extractSourceMappingUrl\\(cssText\\);","replace":"var sourceMappingUrl = \"\";","flags":"g"}!/Users/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/Rxjs/Rx.js
    * /Users/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/string-replace-loader/index.js?{"search":"var sourceMappingUrl = extractSourceMappingUrl\\(cssText\\);","replace":"var sourceMappingUrl = \"\";","flags":"g"}!/Users/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/rxjs/add/operator/map.js
        Used by 1 module(s), i. e.
        /Users/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/@angularclass/hmr-loader/index.js?pretty=true&prod=false!/Users/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/awesome-typescript-loader/dist/entry.js!/Users/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/angular2-template-loader/index.js!/Users/aplicaciones2/Documents/Luchillo-tech-showcase/node_modules/string-replace-loader/index.js?{"search":"(System|SystemJS)(.*[\\n\\r]\\s*\\.|\\.)import\\((.+)\\)","replace":"$1.import($3).then(mod => (mod.__esModule && mod.default) ? mod.default : mod)","flags":"g"}!/Users/aplicaciones2/Documents/Luchillo-tech-showcase/src/vendor.browser.ts

    That one error is repeated aprox 52 times with different rxjs operators.

    So as this happens to me in Mac OSX 'El Capitan', i don't think my issue is with the cd used, any ideas?

    Update: After some digging it happens whenever i import the Rxjs Observable, it seems the string-replace-loader used in the preLoader config in the webpack.common.js file is responsible for that issue.

  9. luchillo17 commented on Sep 13, 2016

    @luchillo17

    Ok found my issue, i'm importing like:

    import { Observable } from 'Rxjs/Observable';
    import { Subscription } from 'Rxjs/Subscription';
    import 'Rxjs/add/operator/debounceTime';
    import 'Rxjs/add/observable/fromEvent';

    When it should be like:

    import { Observable } from 'rxjs/Observable';
    import { Subscription } from 'rxjs/Subscription';
    import 'rxjs/add/operator/debounceTime';
    import 'rxjs/add/observable/fromEvent';

    Note the upper case R in rxjs.

  10. buddyackerman commented on Oct 31, 2016

    @buddyackerman

    @Junik this fix didn't work for me as my path was already set with an upper case drive letter. Is the casing in the path critical as well? I have mixed case in the folders of the path to my project directory.

    e.g. C:\Projects\Angular2\Blah\MyProject

  11. MarkPieszak commented on Nov 18, 2016

    @MarkPieszak

    @buddyackerman I just ran into this on one of my machines and realized I was using Node 6.4, I upgraded to 7.1 and the issues went away, could of been the way I was doing the directory as well, but I believe this has been fixed on the Node end (see nodejs/node#6624)

  12. karocksjoelee commented on Jan 12, 2017

    @karocksjoelee

    I've encountered this issue today , I solve by checking the import components url . In my case is XXX.module.ts & XXX.routing.ts . the url after you import { Anyting } must all in lower case .

    Enviroment: MacOS , node 6.9.1

  13. 30 remaining items

  14. wenxiayili commented on Apr 11, 2018

    @wenxiayili

    @namdeom it resolve my problem too...

  15. zhuy2018 commented on Jul 5, 2018

    @zhuy2018

    我也遇到这个问题了
    warning in F:/Web/vue-cli/vue-examplel/node_modules/webpack/buildin/global.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:\Web\vue-cli\vue-examplel\node_modules\webpack\buildin\global.js
      Used by 2 module(s), i. e.
      F:\Web\vue-cli\vue-examplel\node_modules_sockjs-client@1.1.4@sockjs-client\dist\sockjs.js
    • f:\Web\vue-cli\vue-examplel\node_modules\webpack\buildin\global.js
      Used by 1 module(s), i. e.
      f:\Web\vue-cli\vue-examplel\node_modules\vue\dist\vue.esm.js

    应该怎么解决的??

  16. zhuy2018 commented on Jul 5, 2018

    @zhuy2018

    我解决了,原来不是盘符原因,只要把文件删除了,然后重新导入就OK。
    这坑踩的深,后面人跳过此坑!!!!!!!

  17. PietroLaGrotta commented on Sep 7, 2018

    @PietroLaGrotta

    Simply if you capitalize a file name that is already imported in ather files of you project, node js explodes. It become creazy. I returned the file name to lowercase and node js is returned to run happily :-)

  18. davidqqq commented on Nov 12, 2018

    @davidqqq

    我解决了,原来不是盘符原因,只要把文件删除了,然后重新导入就OK。
    这坑踩的深,后面人跳过此坑!!!!!!!

    This tip actually helped me and would like to translate in English to help people who might need it.

    Here it goes:

    I solved it. It wasn't caused by drive letter. Remove the problematic file and reimport it. It should be OK now.

  19. Tech007Harsh commented on Feb 4, 2019

    @Tech007Harsh

    WARNING in ./node_modules/@Angular/common/fesm5/http.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:\CodeLoverTechnology\Development\Web_Development\NirmanIASWeb\NirmanIASPortal\node_modules@Angular\common\fesm5\http.js
      Used by 16 module(s), i. e.
      F:\CodeLoverTechnology\Development\Web_Development\NirmanIASWeb\NirmanIASPortal\node_modules@ngtools\webpack\src\index.js!F:\CodeLoverTechnology\Development\Web_Development\NirmanIASWeb\NirmanIASPortal\src\app\app.module.ts* F:\CodeLoverTechnology\Development\Web_Development\NirmanIASWeb\NirmanIASPortal\node_modules@angular\common\fesm5\http.js
      Used by 4 module(s), i. e.
      F:\CodeLoverTechnology\Development\Web_Development\NirmanIASWeb\NirmanIASPortal\node_modules@ngtools\webpack\src\index.js!F:\CodeLoverTechnology\Development\Web_Development\NirmanIASWeb\NirmanIASPortal\src\app\Services\SubCategoryService\sub-category-master.service.ts
  20. Tech007Harsh commented on Feb 4, 2019

    @Tech007Harsh

    i am also encountering this problem.. i have services to post and get, two of them are working fine but others are not and showing 400 bad request ... but nothing is wrong in the code..i think i am encountering unexpected behavior while compiling,i am posting other service and the source is showing other html and hence giving 400 bad request.

  21. Isaquedias commented on May 5, 2019

    @Isaquedias

    No meu caso eu tinha uma pasta
    /Pages
    troquei por
    /pages

    coloquei em minusculo

  22. ivan-nemtinov commented on Dec 13, 2019

    @ivan-nemtinov

    Webpack shows a warning "There are multiple modules with names that only differ in casing" when executed from a terminal of VSCode on Windows, and a default shell of a Terminal is "Command prompt", which uses small letters for drive names.
    Solution:

    1. In VSCode, open command palette (CTRL+SHIFT+P)
    2. Enter a command "Terminal: Select default shell"
    3. Choose Powershell or Bash.
  23. const-int commented on May 19, 2020

    @const-int

    In my case it was lowercase user folder in the path.

    I changed C:\users\admin\project to C:\Users\admin\project and it works fine.

    Windows 10, PowerShell

  24. vuongvgc commented on May 30, 2020

    @vuongvgc

    If u use VS Code try change path to project from
    c:[path to angular2-webpack-starter]
    to
    C:[path to angular2-webpack-starter]

    in @dyh333 case fix:
    e:\GitHub\angular2-webpack-starter> cd E:\GitHub\angular2-webpack-starter
    npm start
    in your terminal or cli

    thanks. This is my issue. So i can fix.

  25. ShahriarKh commented on May 28, 2021

    @ShahriarKh

    Had the same problem in a react project.
    Solution: I was naming a css file in camelCase 😑

  26. wallace-lw commented on Jun 13, 2022

    @wallace-lw

    I had the same issue, i just fix renaming the import: Import React, {ReactNode} from 'React'; to Import React, {ReactNode} from 'react;

  27. naveenmorla1901 commented on Mar 13, 2024

    @naveenmorla1901

    I changed my project path
    ex: C:\Users\name\documents\project\ to C:\Users\name\Documents\Project
    Check for the original format in the folder location and try changing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions