Deployment fails due to filename cases

I have an react app, this is my repo, GitHub - tpszhao/instagram-clone

I here are two consecutive deploys

failed:

Cannot find module: ‘Reducers/infiniteLoaderReducer’. Make sure this package is installed.

In order to fix this issue, I simply capitalized the filename, hence the file is now called “InfiniteLoaderReducer”

If you check my deploy history:Netlify App

I had several consecutive fails

Cannot find module: ‘themes’
Cannot find module: ‘api/local’ ← this is ‘api/local.js’

The problem is, they are all folders inside of my “src” directory. In order to fix them, I had to capitalize all of them. Everything builds fine locally.

  1. What causes this behaviour? The all build successfully locally.

  2. Inside of my API folder, I did not need to rename “local.js” to “Local.js”. But why is it that changing “InfiniteLoaderReducer.js” to “infiniteLoaderReduce.js” inside of my Reducers folder causes the build failure?

I’m trying to see how this naming inconsistency causes the problem but the two issues I described earlier also doesn’t make sense either

…I figured out the cause, will keep this post here in case someone else encounters a similar issue

The reason is because I originally had a folder name “Themes”, but windows ignores casing for foldernames. So in order to change from “Themes” to lowercase, I had to “delete” the folder, commit, then rename to lowercase.

Hey there, what you are describing is quite common - so common, in fact, that we wrote an article on it:

This should help!