angular / angular-cli

CLI tool for Angular
https://cli.angular.io
MIT License
26.77k stars 11.98k forks source link

There are multiple modules with names that only differ in casing. #5126

Closed kerwin612 closed 7 years ago

kerwin612 commented 7 years ago

Please provide us with the following information:

OS?

Windows 10 [MINGW64 -> git-bash for windows]

Versions.

$ ng -v
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.0.0-rc.0
node: 6.10.0
os: win32 x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-rc.0
@angular/compiler-cli: 2.4.8

Repro steps.

app.component.ts

@Component({
  selector: 'app',
  styleUrls: [
    './app.component.css'
  ],
  template: `
    ...
  `
})
export class AppComponent implements OnInit { ... }

warning

$ cnpm start

> ng2-proj@0.0.0 start H:\a0a\ws\ng2-da
> ng serve

** NG Live Development Server is running on http://localhost:4200 **
Hash: 6f8d77c1639eead950f6
Time: 22080ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 153 kB {3} [initial] [rendered]
chunk    {1} styles.bundle.js, styles.bundle.js.map (styles) 58.2 kB {3} [initial] [rendered]
chunk    {2} main.bundle.js, main.bundle.js.map (main) 3 MB [initial] [rendered]
chunk    {3} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

WARNING in ../ng2-proj/~/.0.26.2@css-loader/lib/css-base.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:
* H:\a0a\ws\ng2-proj\node_modules\.0.1.6@source-map-loader\index.js!H:\a0a\ws\ng2-proj\node_modules\.0.26.2@css-loader\lib\css-base.js
    Used by 2 module(s), i. e.
    H:\a0a\ws\ng2-proj\node_modules\.0.26.2@css-loader\index.js?{"sourceMap":false,"importLoaders":1}!H:\a0a\ws\ng2-proj\node_modules\.0.13.0@postcss-loader\index.js!H:\a0a\ws\ng2-da\src\styles\common.css
* H:\a0a\ws\ng2-proj\node_modules\.0.1.6@source-map-loader\index.js!h:\a0a\ws\ng2-proj\node_modules\.0.26.2@css-loader\lib\css-base.js
    Used by 1 module(s), i. e.
    H:\a0a\ws\ng2-proj\node_modules\.0.6.4@exports-loader\index.js?module.exports.toString()!H:\a0a\ws\ng2-proj\node_modules\.0.26.2@css-loader\index.js?{"sourceMap":false,"importLoaders":1}!H:\a0a\ws\ng2-proj\node_modules\.0.13.0@postcss-loader\index.js!h:\a0a\ws\ng2-da\src\app05\app.component.css
webpack: Compiled with warnings.

app.component.ts

@Component({
  selector: 'app',
  template: `
    ...
  `
})
export class AppComponent implements OnInit { ... }

success

$ cnpm start

> ng2-proj@0.0.0 start H:\a0a\ws\ng2-da
> ng serve

** NG Live Development Server is running on http://localhost:4200 **
Hash: dd34e8f8e812d41aac01
Time: 21175ms
chunk    {0} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 153 kB {3} [initial] [rendered]
chunk    {1} styles.bundle.js, styles.bundle.js.map (styles) 58.2 kB {3} [initial] [rendered]
chunk    {2} main.bundle.js, main.bundle.js.map (main) 3 MB [initial] [rendered]
chunk    {3} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]
webpack: Compiled successfully.

The log given by the failure.

Normally this include a stack trace and some more information.

Mention any other details that might be useful.


Thanks! We'll be in touch soon.

ghost commented 7 years ago

@ileler check references. You may added one or more references (probably in css) to another file, using different casing in path or filename. On Windows it still gonna work, but on Linux, for instance, it will fail.

Brocco commented 7 years ago

I have researched this a bit and it appears that the drive letter you're using may the cause... more specifically the case of the drive letter you're using.

If you are currently use c:\path-to-project try changing it to C:\path-to-project

This has been reported by multiple people on multiple build tools it does not appear to be an issue with the CLI itself, therefore closing this issue.

oliamb commented 7 years ago

I can reproduce it on Mac, not sure from where it comes but it might be from the cli or the ng tools.

Here are my different spelling:

/Users/oliamb/p4d/spa/node_modules/@ngtools/webpack/src/index.js!/-->U<---sers/oliamb/p4d/spa/src/shared/rx/operator/pipe-into.ts
/Users/oliamb/p4d/spa/node_modules/@ngtools/webpack/src/index.js!/-->u<--sers*/oliamb/p4d/spa/src/shared/rx/operator/pipe-into.ts

The build then crashes with this lovely little thingie

WARNING in ./src/store/user/user.selectors.ts
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/oliamb/p4d/spa/node_modules/@ngtools/webpack/src/index.js!/Users/oliamb/p4d/spa/src/store/user/user.selectors.ts
    Used by 1 module(s), i. e.
    /Users/oliamb/p4d/spa/node_modules/@ngtools/webpack/src/index.js!/Users/oliamb/p4d/spa/src/store/user/index.ts
* /Users/oliamb/p4d/spa/node_modules/@ngtools/webpack/src/index.js!/users/oliamb/p4d/spa/src/store/user/user.selectors.ts
    Used by 1 module(s), i. e.
    /Users/oliamb/p4d/spa/node_modules/@ngtools/webpack/src/index.js!/users/oliamb/p4d/spa/src/store/user/index.ts

WARNING in ./src/shared/utils/map-obj.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/oliamb/p4d/spa/node_modules/source-map-loader/index.js!/Users/oliamb/p4d/spa/src/shared/utils/map-obj.js
    Used by 1 module(s), i. e.
    /Users/oliamb/p4d/spa/node_modules/@ngtools/webpack/src/index.js!/Users/oliamb/p4d/spa/src/shared/utils/utils.ts
* /Users/oliamb/p4d/spa/node_modules/source-map-loader/index.js!/users/oliamb/p4d/spa/src/shared/utils/map-obj.js
    Used by 1 module(s), i. e.
    /Users/oliamb/p4d/spa/node_modules/@ngtools/webpack/src/index.js!/users/oliamb/p4d/spa/src/shared/utils/utils.ts

ERROR in Error encountered resolving symbol values statically. Calling function 'ɵmakeDecorator', function calls are not supported. Consider replacing the function or lambda with a reference to an exported function, resolving symbol NgModule in /users/oliamb/p4d/spa/node_modules/@angular/core/typings/core.d.ts, resolving symbol StoreMonitoringModule in /users/oliamb/p4d/spa/src/store/effects/monitoring/store-monitoring.module.ts, resolving symbol StoreMonitoringModule in /users/oliamb/p4d/spa/src/store/effects/monitoring/store-monitoring.module.ts

I can fix it by moving my project somewhere else on my system, where there is no uppercase letter in the path.

Notes that my colleagues, working on Linux with a case-sensitive disk partition don't get any of those warnings and can compile successfully.

ipassynk commented 7 years ago

upgrading angular2 to angular4 project with cli get to the same issue on MAC. My path is /Users/juliapassynkova and it gives errors about. I tried to install node7, reinstall angular cli, clean npm modules, do cd '/users/juliapassynkova/...' in xterm and do ng serve there. Nothing helped but only moving the project to a folder without capcital letter and the same project compilied without warnings.

Here is warnings

WARNING in ./src/app/detail-planning/slot-details/util/slot.util.ts
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/juliapassynkova/ctc/projects/5390-promo/promo-client-v4/node_modules/@ngtools/webpack/src/index.js!/Users/juliapassynkova/ctc/projects/5390-promo/promo-client-v4/src/app/detail-planning/slot-details/util/slot.util.ts
    Used by 1 module(s), i. e.
    /Users/juliapassynkova/ctc/projects/5390-promo/promo-client-v4/node_modules/@ngtools/webpack/src/index.js!/Users/juliapassynkova/ctc/projects/5390-promo/promo-client-v4/src/app/detail-planning/slot-details/index.ts
* /Users/juliapassynkova/ctc/projects/5390-promo/promo-client-v4/node_modules/@ngtools/webpack/src/index.js!/users/juliapassynkova/ctc/projects/5390-promo/promo-client-v4/src/app/detail-planning/slot-details/util/slot.util.ts
    Used by 1 module(s), i. e.
    /Users/juliapassynkova/ctc/projects/5390-promo/promo-client-v4/node_modules/@ngtools/webpack/src/index.js!/Users/juliapassynkova/ctc/projects/5390-promo/promo-client-v4/src/app/detail-planning/slot-details/sku-view/sku-view.component.ts
gangadharjannu commented 7 years ago

I got this issue when I mistakenly imported 'Router' instead of router. So I've used
import { Router } from '@angular/Router'; instead of
import { Router } from '@angular/router'; (Correct one)

PsychicCat commented 7 years ago

i have the exact same problem as @ipassynk and @oliamb on OSX. works fine compiling on Linux.

18steps commented 7 years ago

I am on Windows 7 -- and I get like 50 of these. They weren't here yesterday, so I'm not sure what changed. In my error messages, it seems like the tooling is putting a capital C drive some places and lowercase c other places.

WARNING in ./src/app/app-routing.module.ts
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other c
ase-semantic.
Use equal casing. Compare these module identifiers:
* C:\dev\coop\bot-mgmt\node_modules\@ngtools\webpack\src\index.js!C:\dev\coop\bo
t-mgmt\src\app\app-routing.module.ts
    Used by 1 module(s), i. e.
    C:\dev\coop\bot-mgmt\node_modules\@ngtools\webpack\src\index.js!C:\dev\coop\
bot-mgmt\src\app\app.module.ts
* C:\dev\coop\bot-mgmt\node_modules\@ngtools\webpack\src\index.js!c:\dev\coop\bo
t-mgmt\src\app\app-routing.module.ts
    Used by 1 module(s), i. e.
    C:\dev\coop\bot-mgmt\node_modules\@ngtools\webpack\src\index.js!c:\dev\coop\
bot-mgmt\src\app\oppskrift\oppskrift.module.ts

WARNING in ./src/app/app-materials.module.ts
There are multiple modules with names that only differ in casing.
This can lead to unexpected behavior when compiling on a filesystem with other c
ase-semantic.
Use equal casing. Compare these module identifiers:
* C:\dev\coop\bot-mgmt\node_modules\@ngtools\webpack\src\index.js!C:\dev\coop\bo
t-mgmt\src\app\app-materials.module.ts
    Used by 1 module(s), i. e.
    C:\dev\coop\bot-mgmt\node_modules\@ngtools\webpack\src\index.js!C:\dev\coop\
bot-mgmt\src\app\app.module.ts
* C:\dev\coop\bot-mgmt\node_modules\@ngtools\webpack\src\index.js!c:\dev\coop\bo
t-mgmt\src\app\app-materials.module.ts
    Used by 1 module(s), i. e.
    C:\dev\coop\bot-mgmt\node_modules\@ngtools\webpack\src\index.js!c:\dev\coop\
bot-mgmt\src\app\oppskrift\oppskrift.module.ts

In the components mentioned by the error messages, I am not importing anything with capital letters, and I am not mentioning the C drive at all. My app is not ejected, so I can't look to webpack.config.json to see what it might be, and in .angular-cli.json I am likewise not mentioning the C drive or using any capital letters in the values.

I find it extremely odd that this was working yesterday - I've closed command prompts and Webstorm since then, but not reset my computer, so it's strange that the behavior wouldn't be the same both days.

18steps commented 7 years ago

Solved the issue following https://github.com/webpack/webpack/issues/2362#issuecomment-219172135

I use a shortcut to start the command prompt, and I said the starting folder should be "C:/dev/" -- when I changed it to "c:/dev" all my problems were gone.

jagadeshanh commented 7 years ago

I had a same problem

My folder structure was

Components --Home --Hotel

Modules --Home --Hotel

and while in import i had small letter import home from '../components/home/component'

this was the problem.

sanazBG commented 6 years ago

Using react as a front-end framework .. It doesn't matter how you type the driver letter .. Any folder in my server directory(including the server directory) should be typed with small letters .. that fixed the warning for me and got a "Compiled Successfully" absolutely every warning came from my "client" directory .. thats on Windows.

nrgini commented 6 years ago

I had the some warning when working on a react app project for Codecademy. Using Git Bash, enter npm uninstall react-scripts --save and then npm install react-scripts --save-dev worked for me. Thanks to a Codecademy advisor!

Prashantko commented 5 years ago

@Brocco, you are correct in my case my path was like this before D:\LearningAngular7\Angular7\src\app\Orders\order\order.component.html I changed it to D:\LearningAngular7\Angular7\src\app\orders\order\order.component.html

now it is working

PoojaDhande commented 5 years ago

WARNING in ./src/app/Society/SocietyService/society.service.ts 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:

httpete commented 5 years ago

Solved the issue following webpack/webpack#2362 (comment)

I use a shortcut to start the command prompt, and I said the starting folder should be "C:/dev/" -- when I changed it to "c:/dev" all my problems were gone.

There is a setting in Visual Studio code that lets you define the start folder for gitbash, set it to lowercase c:\something and it will stop barking the casing warnings.

angular-automatic-lock-bot[bot] commented 5 years ago

This issue has been automatically locked due to inactivity. Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.