Build Failed - Netlify looks for "Layout" instead of "layout" - Gatsby App

My netlify build is failing because it cannot resolve the Layout component in …/…/Layout

The app works in development

4:04:28 PM: failed Building production JavaScript and CSS bundles - 11.920s

4:04:28 PM: error Generating JavaScript bundles failed

4:04:28 PM: Can't resolve '../components/Layout' in '/opt/build/repo/src/pages'

4:04:28 PM: If you're trying to use a package make sure that '../components/Layout' is installed. If you're trying to use a local file make sure that the path is correct.

However the name of the folder is layout with a small “l”, so why is Netlify looking for a “Layout” folder with a capital L

Is there a way to turn off Netlify’s case sensitivity?

Renaming the folder to Layout with a capital L will break the application as all the files point to a layout folder with a small l.

The solution is to create duplicate files on the github website → go to “New File” and create one file called “layout.js” and a second file called “Layout.js” with exactly the same content in both.

Silly solution but it works. Definitely a Netlify bug that needs fixed.

Before claiming the bug, did you read this:

Hi, I read all that but the problem is that the build checks for layout.js AND Layout.js - and if it is missing just one of them, the build doesn’t work. Netlify should only be checking for one out of those two files.

All of the solutions on that Stack Overflow do not work for me.

The only solution I found was to duplicate layout.js as Layout.js and keep both files - that is the only thing after hours of trying solutions that worked.

Therefore I do not believe the error is caused by a “case-insensitive” system but rather Netlify checking for more files than it should be checking for.

Hey there, @juliusgoddard :wave:

Can you share your site as well as your most recent deploy log? This will help us verify if this is a known case-sensitivity situation or a bug. Thank you!