webpack: There is another module with an equal name when case is ignored.

i use windows 10 x64 I upgrade node to 6.3.1 version and get:

WARNING in ./modules/ui-js/dom/core/html-parser.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.

WARNING in C:/localhost/ui-js/modules/ui-js/dom/core/html-parser.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.

This is error for ALL files in path modules/ui-js

Webpack config:

resolve: {
  modulesDirectories: ['modules', 'node_modules'],
  extensions: ['', '.js', '.coffee']
},

modules directory i use to storage my custom npm modules

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 22 (6 by maintainers)

Commits related to this issue

Most upvoted comments

I have the same issue - I get the warning, and the said module is included twice in my bundle.

Env: Windows 7 x64, webpack 1.13.1, node 6.3.0.

WARNING in c:/dev/xxx/app/folder/constants.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.

WARNING in ./app/folder/constants.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.

webpack config:

resolve: {
  root: [
    path.resolve('./app')
  ]
}

(the purpose is to avoid many messy …/…/…/foo/bar style relative imports)

Necessary condition:

  • a module imports constants.js via import { NAME } from 'folder/constants';
  • another module imports constants.js via import { NAME } from ‘./constants’;

Bundle contains:

  • ./app/folder/constants.js
  • c:/dev/xxx/app/folder/constants.js

NodeJS has a long-standing bug with drive letter casing #6774. You can fix everything else with keeping paths case sensitive and matching the actual path to the resource. The problem is some NodeJS API’s will return uppercase drive letters; __dirname for example.

Webpack doesn’t want to fix this because it’s not really a Webpack issue. However, there is a simple fix in /lib/NormalModule.js which forces the identifier to use a lower case drive letter.

I have started on a pull request but the real solution is to put an option into the CLI that will force the case of the drive letter (only) to either lower or upper case for consistency. It turns out that it’s much harder to update the CLI tools than to fix the webpack code where all is required is a regex and a replacement.

This matters on windows in particular.

https://github.com/nodejs/node-v0.x-archive/pull/6774