Create-react-app: Webpack warning: There is another module with an equal name when case is ignored

Created on 6 Sep 2016  路  16Comments  路  Source: facebook/create-react-app

I'm using 0.4.1 version and I get:

Warning in (webpack)/buildin/module.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 ./~/react-scripts/~/webpack/buildin/module.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.

when I run the app by npm start

bug underlying tools

Most helpful comment

I was able to reproduce with the following steps:

  1. On a Windows machine, create a new directory 'TEST'. (Doesn't matter what you name it, just put in caps somewhere).
  2. In your CLI navigate to your directory and create-react-app app-test within it.
  3. npm start
  4. Terminate the development server
  5. In some other window, without closing your currently open CLI (explorer, another CLI environment), rename 'TEST' to 'test'. (Change the case to its opposite case, whatever you named it).
  6. Return to your original CLI and run npm start to receive these errors.

This happened to me earlier today while I was doing some file cleanup while also developing. I was able to clear them out by cd.. out back to the root path (just before 'TEST') and navigating back in, then running npm start. Not sure what could cause it to happen consistently, but it might be related to some file structure changes during development.

All 16 comments

Can you publish a minimal project reproducing this issue? Also some details would be helpful: your OS and project location on the disk.

@gaearon It'll be hard to extract some code to publish it here. I can't use this code outside of my project. It's even simple. I've created an app using create-react-app calculator

package.json deps looks like this one:

  "devDependencies": {
    "react-scripts": "0.4.1"
  },
  "dependencies": {
    "moment": "^2.14.1",
    "moment-range": "^2.2.0",
    "rc-calendar": "^7.0.4",
    "react": "^15.3.1",
    "react-dom": "^15.3.1"
  }

I'm using Windows 10, 64bit.
My project is located at: C:\Dev\Projects\calculator

I run the npm start script from standard Windows CMD and I'm in the project directory.

Maybe it's the same issue as https://github.com/facebookincubator/create-react-app/issues/472. Can you try reading through that thread an doing the same diagnostic logs?

We might have to disable that plugin until this is fixed.

cc @Urthen

@gaearon I've added console.log('Path', paths.appHtml); to node_modules/react_scripts/config/webpack.config.dev.js as it was mentioned in #472
and I got: c:\Dev\Projects\calculator\index.html

I have Node v6.3.1

Can you consistently reproduce this when you create a new project right away? Or do you only get a warning after installing some dependencies?

@gaearon

It's weird. I've created new react-test app using create-react-app react-test and:

  • npm start - ok, without warning
  • npm install --save moment
  • npm start - ok, without warning
  • npm install --save moment-range
  • npm start - ok, without warning
  • npm install --save rc-calendar
  • npm start - ok, without warning

App is running without any warnings.

Hmm. So you can't reproduce this anymore? Are you creating the project in the same directory as before?

I still get this warnings in my calculator project. Warnings are showing on the console, but an app works fine.

react-test was created on my desktop. It seems to be similar case to #472

Checking in on this - I don't think case-sensitive-paths would have any interaction here. It is designed to throw an error before this warning occurs, but I don't see a way it could cause it.

At some point I know there was discussion of shortening the error messages. Look like the (webpack) in the first message is some sort of token for the full webpack path as described in the second message. It could be obscuring the actual error, or even be causing the warning, depending on how it was implemented and how webpack attempts to detect duplicate modules.

Ooh, so this warning comes from Webpack itself! I didn't realize this.

We should file a bug but this really needs a minimal reproducing case.

Lifting the milestone because I don鈥檛 quite understand what鈥檚 going on here.

For now I would recommend creating the project in some different folder, or maybe using PowerShell instead of Windows Cmd.

Please let me know if either resolves the problem.

I鈥檓 closing because there are no more details, and I found no way to reproduce this. If you find a reliably way to repro, please reopen!

I was able to reproduce with the following steps:

  1. On a Windows machine, create a new directory 'TEST'. (Doesn't matter what you name it, just put in caps somewhere).
  2. In your CLI navigate to your directory and create-react-app app-test within it.
  3. npm start
  4. Terminate the development server
  5. In some other window, without closing your currently open CLI (explorer, another CLI environment), rename 'TEST' to 'test'. (Change the case to its opposite case, whatever you named it).
  6. Return to your original CLI and run npm start to receive these errors.

This happened to me earlier today while I was doing some file cleanup while also developing. I was able to clear them out by cd.. out back to the root path (just before 'TEST') and navigating back in, then running npm start. Not sure what could cause it to happen consistently, but it might be related to some file structure changes during development.

@jemgraves wow, that's SUPER weird. I wonder if it's something to do with the windows OS caching the directory structure as part of the console environment or something? Off the top of my head this seems more of an OS bug (or at least inconsistency) than anything else. Perhaps someone more familiar with windows dev could confirm.

Edit: actually, maybe webpack is doing the caching. I'll dig into this a bit more.

@Urthen Thanks for taking a look!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stopachka picture stopachka  路  3Comments

onelson picture onelson  路  3Comments

xgqfrms-GitHub picture xgqfrms-GitHub  路  3Comments

rdamian3 picture rdamian3  路  3Comments

alleroux picture alleroux  路  3Comments