Gatsby 3 with Contentful CMS deploy fails, while sometimes deploy successfully

Site name: bugdetective (
Git hub source code:
Primary domain:

Failed deploy logs:
click here to see the logs
click here to see the logs

Between two failed deploy, there is a successful deploy log:
click here to see the logs

In my local environment, the build is always success.

What I feel strange is that sometimes I did not change the “code” at all, I just change some “content” from CMS, then CMS trigger Netlify rebuild, and then the build result changed. It may change from fail to success, and may change from success to fail.

My local development environment is:
node: v14.16.1
npm: 7.12.0
python: 2.7.10
ruby: 2.3.7
gatsby: 3.4.2
gatsby-cli: 3.4.1
OS: macOS 10.13.6

To reproduce the fail, you may need to follow the of the repo:

I have tried uploading .nvmrc, and have tried changing environmental variable to be as close as to my local development environment. It still didn’t work. If any one can give me any idea to find out what’s going on, I’ll be very appreciate it. Thank you.

The deploy logs that you’ve linked are all private. Could you paste the text somewhere so we can check?

Oh~ I didn’t notice the deploy logs aren’t public. I pasted them to links, and updated the post. Thank you for reminding me.

The local screenshot that you’ve posted is of the development build. Does it still always work locally when you run the production build?

Furthermore, there seem to be many threads online and a few on Gatsby GitHub too which mention this error. A few of them could get it working by changing the dependency versions. There are a few more suggestions

It does still always work locally running the production build.
Click here to see the logs

Thanks for the suggestion, I’ll study the issue of Gatsby you mentioned, and report you what happens.

@hrishikesh I think the proplem is solved. In the tread you provided, I found someone changed file name Layout.js to layout.js to solve the problem, so I went back to check my code.

I found in the github, I have two folders, seo and Seo, while I only have seo in my local repo. :thinking: I think the error occurred when I had changed seo to Seo or Seo to seo. The reason may be is that the default file system of macOS is case insensitive, and the github is also case insensitive, while the file system of Linux on Netlify is case sensitive.

I think maybe this is the reason the build on Netlify failed while the build on local success. The code on Nelify has conflict with the file name of file system and the local code doesn’t have this conflict.

Anyway, after I make sure the file name on the github, on my mac and in the code are all the same, the build works. :grin:

The steps I make my git at local and github change file name from seo to Seo is:

  1. rename seo to sss.
  2. commit.
  3. rename sss to Seo.
  4. commit.

There is more specific information about the case sensitivity problem between github and local file system here.

And thanks for your information again.

1 Like

Thank you so much for coming back and updating this thread with your solution, @yellowful :netliconfetti: This will definitely be beneficial for future Forums members who encounter something similar.

1 Like