Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack Warning - There is another module with equal name when case is ignored #82

Closed
AndyOGo opened this issue May 12, 2016 · 8 comments

Comments

@AndyOGo
Copy link

AndyOGo commented May 12, 2016

My Webpack build logs the following warning:

WARNING in ./~/classNames/index.js
There is another module with an equal name when case is ignored.
This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Rename module if multiple modules are expected or use equal casing if one module is expected.

I checked the webpack repo and they have a related issue #382

I use ES2015 module syntax as follows:

import classNames from 'classnames';

I quickly checked your code and found two possible parts causing this warning:

  • it exports two additional variations (dedupe and bind) as the same name.
  • The module names used to export as AMD and CommonJS Syntax are not consistent - classNames vs. classnames
@AndyOGo
Copy link
Author

AndyOGo commented May 12, 2016

Okay I investigated the issue more carefully. As it turns out it is quite simple.
Just use the CommonJS module key:

import classNames from 'classNames';

I leave it open, because inconsistency in module names for different module syntax is a bad practise.

@stevemao
Copy link

probably better to keep it all lowercased classname.

@dcousens
Copy link
Collaborator

probably better to keep it all lowercased classname.

Agreed, but that is now a massive breaking change for anyone using bower.

@AndyOGo
Copy link
Author

AndyOGo commented Jun 15, 2016

Agree, it is definitely a breaking change. So I would put it in a Major release.

@dcousens
Copy link
Collaborator

I vote the AMD exports are removed entirely; then this is a non-issue.

@anilanar
Copy link

anilanar commented Jul 8, 2017

Assuming most people have now switched to ES imports, why doesn't classnames have an ES6 main file using module key in package.json? module.exports can be mapped to ES in 2 different ways (wildcard import and default import) which causes issues if used in a complicated scenarios with typescript, babel, node etc.

@a932455223
Copy link

The issue help me solve my problem.Thanks.

@dcousens
Copy link
Collaborator

dcousens commented Jul 20, 2018

Probably resolved by #150, closing in favour of that (unless it isn't, in which case, re-open)

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

No branches or pull requests

6 participants