So, when I run gatsby develop OR gatsby clean && gatsby build && gatsby serve, everything works fine: no errors at all.

If I FTP the files in the public folder to my own web server, everything works fine: no errors at all.

Only when I push to GitHub and it gets deployed to Netlify, I’m getting weird errors that should not occur.
Can anyone help me with this? I’m new to Netlify and this is already a major turn-off for me…

Note: This article is only about builds within Netlify’s Continuous Integration (CI) environment, as triggered from git commits or from incoming build webhooks. You can learn more in depth about how Netlify builds your site in this article about how our build bots build sites.
Some background
There are a fair number of reasons that a build could fail in Netlify’s CI environment, even if building works locally. Testing locally is always the place to start, and the thing we will recommend to you …

Am a bit surprised you have a package.json and not a yarn.lock for a gatsby project - seems like most of them I see use yarn instead of npm. That’s not necessarily wrong, you’re just in the minority and that article I linked talks about how to make sure we’re using the same tool as well as version as you.