Home
Support Forums

Gatsby build errors but Netlify does not exit

My site here: safebeachday.netlify.app is a gatsby site built on Netlify.

For some reason when the Gatsby build phase has an error the Netlify build does not exit. This was never the case with past projects.

I had to turn off auto-publishing because when the Gatsby build fails Netlify would still publish a broken site. Here is an example: Netlify App

My expectation is that Netlify should exit and show a failed build when there is an error in the Gatsby build process.

Hi @Trevor7,

It’s your build command that needs to send an error exit code when it fails. Netlify purely relies on the exit code and not on the logs shown by the build. If the logs show failed, but the exit code is successful, the build will be published.