Gatsby site fails to build on Netlify, but works locally

so, looking at your package.json i do see that some of these packages are a little out of date. For example, gatsby-transformer-json current version is 2.4.0:

also there have been newer versions of gatsby etc released since then. I’m going to make an educated guess that the problem you are seeing is due to some minor version incompatability.

what you might try is to commit your local package lock that you know works, and then clear cache & redeploy. the netlify system should respect the exact minor versions that are specified in the lock file that are known to work (as opposed to grabbing the versions indicated in the package.json. in a perfect world, all minor versions would always play nice and there would be no weird conflicts. that is not the world we live in, so the lock file “locks” a specific config that is known to work.)

it’s important to clear the cache tho so we don’t end up with a half-updated set of dependencies when you deploy.

let me know how it goes.

just in case, here is the other issue that sometimes pops up when deploying but not locally, but as i said, i don’t think thats your issue, but i have definitely been wrong before: