Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React error: warn There are multiple modules with names that only differ in casing

Tags:

reactjs

gatsby

I am getting a warning about having 'multiple modules with names that only differ in casing'.

What I tried: Change import declarations of react, delete node modules and reinstall with npm i.

This is how I import react in my components: import React from 'react'

Here is the warning message:

This can lead to unexpected behavior when compiling on a filesystem with other case-semantic.
Use equal casing. Compare these module identifiers:
* /Users/Downloads/website/node_modules/gatsby/dist/utils/babel-loader.js??ref--4-0!/Users/Downloads/website/node_modules/eslint-loader/index.js??ref--11-0!/Users/Downloads/website/src/components/DiscoverBannerIndex.js
    Used by 6 module(s), i. e.
    /Users/Downloads/website/node_modules/gatsby/dist/utils/babel-loader.js??ref--4-0!/Users/Downloads/website/node_modules/eslint-loader/index.js??ref--11-0!/Users/Downloads/website/src/pages/download/windows.js
* /Users/Downloads/website/node_modules/gatsby/dist/utils/babel-loader.js??ref--4-0!/Users/Downloads/website```
like image 428
Blueris Avatar asked Oct 27 '25 07:10

Blueris


1 Answers

Typically this error means you've done something like this:

// in one file:
import Foo from "src/components/Foo"

// in another file:
import Foo from "src/components/foo"
like image 102
coreyward Avatar answered Oct 28 '25 20:10

coreyward



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!