Deployment fails due to filename cases

I have an react app, this is my repo, https://github.com/tpszhao/instagram-clone

I here are two consecutive deploys

failed:
https://app.netlify.com/sites/tpszhao-instagram-clone/deploys/5e7105b1a4c78e000841b3f6

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:https://app.netlify.com/sites/tpszhao-instagram-clone/deploys

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!