PatrickJS-starter icon indicating copy to clipboard operation
PatrickJS-starter copied to clipboard

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

Open dyh333 opened this issue 10 years ago • 55 comments

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

dyh333 avatar Aug 30 '16 02:08 dyh333

Same here

inska avatar Sep 01 '16 09:09 inska

me too ㅠㅠ

junyun0516 avatar Sep 05 '16 06:09 junyun0516

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

Junik avatar Sep 07 '16 09:09 Junik

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

PatrickJS avatar Sep 09 '16 03:09 PatrickJS

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

alvipeo avatar Sep 09 '16 05:09 alvipeo

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

PatrickJS avatar Sep 09 '16 07:09 PatrickJS

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

aminebizid avatar Sep 09 '16 09:09 aminebizid

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.

luchillo17 avatar Sep 13 '16 16:09 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.

luchillo17 avatar Sep 13 '16 16:09 luchillo17

@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

buddyackerman avatar Oct 31 '16 14:10 buddyackerman

@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 https://github.com/nodejs/node/issues/6624)

MarkPieszak avatar Nov 18 '16 16:11 MarkPieszak

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

karocksjoelee avatar Jan 12 '17 07:01 karocksjoelee

In my code I resolved this issue by updating:

import { Component, OnInit } from '@angular/Core' to import { Component, OnInit } from '@angular/core'

Vishal-vash avatar Feb 03 '17 16:02 Vishal-vash

This is usually a result of a miniscule typo. If you are importing your modules like import angular from 'angular', import React from 'react' => Go through your files and check where you used < from 'React'> or <from 'Angular'> The error descriptions should have been written more clearly, but what I explained has been the cause of my problem each time I for this error on webpack commands.

Babazon avatar Feb 23 '17 16:02 Babazon

@Babazon For me I had capitalized Radium like this: import Radium from 'Radium' when I should have imported it like this: import Radium from 'radium'

The error went away.

protoEvangelion avatar Feb 28 '17 03:02 protoEvangelion

这个应该是命令行的问题,我也遇到的,我今天改了cmder的启动路径 cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:e:\ 然后也出现了类似的问题

* E:\lanyue\vue\admin-customer\node_modules\.2.2.1@webpack\buildin\global.js
    Used by 1 module(s), i. e.
    E:\lanyue\vue\admin-customer\node_modules\.2.2.1@vue\dist\vue.esm.js
* e:\lanyue\vue\admin-customer\node_modules\.2.2.1@webpack\buildin\global.js
    Used by 2 module(s), i. e.
    e:\lanyue\vue\admin-customer\node_modules\echarts\lib\echarts.js

原来是这个盘符写成小写了,于是我改成大写就好了

cmd /k "%ConEmuDir%\..\init.bat" -new_console:d:E:\

mengdu avatar Apr 14 '17 07:04 mengdu

Looks like anything after @angular in import statements should be in lower case. e.g. @angular/core, @angular/router

Sometimes if you type @angular/Core or @angular/Router you may get this error. So check all the places where you have import @angular for incorrect case.

To be more specific you may want to check all your import statements and check if it maps to whatever inside the node_modules folder.

Please refer above comments "luchillo17 commented on Sep 13, 2016"

birjitningomba avatar Apr 25 '17 18:04 birjitningomba

I could resolve the issue after making all folder name small.Earlier I was using camel case and it was failing.

namdeom avatar May 18 '17 23:05 namdeom

原来不是我一个人遇到这个问题!

zjh65204 avatar Jun 26 '17 01:06 zjh65204

我也遇到了 发现就是一个import 路径的一个字母大小写写错了。

i got the issue like :

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/fydor/Desktop/work/CongZhi/wex-front/node_modules/babel-loader/lib/index.js??ref--0-0!/Users/fydor/Desktop/work/CongZhi/wex-front/app/component/Course/CourseList.jsx
    Used by 1 module(s), i. e.
    /Users/fydor/Desktop/work/CongZhi/wex-front/node_modules/babel-loader/lib/index.js??ref--0-0!/Users/fydor/Desktop/work/CongZhi/wex-front/app/component/Course/CourseMore.jsx
* /Users/fydor/Desktop/work/CongZhi/wex-front/node_modules/babel-loader/lib/index.js??ref--0-0!/Users/fydor/Desktop/work/CongZhi/wex-front/app/component/course/CourseList.jsx
    Used by 3 module(s), i. e.
    /Users/fydor/Desktop/work/CongZhi/wex-front/node_modules/babel-loader/lib/index.js??ref--0-0!/Users/fydor/Desktop/work/CongZhi/wex-front/app/component/home/Home.jsx

found my issue, i'm importing like:

//CourseList import CourseMore from './component/Course/CourseMore.jsx';

the right is like:

//CourseList import CourseMore from './component/course/CourseMore.jsx'; due to the 'c'

fygethub avatar Jul 09 '17 10:07 fygethub