Build failed with an error, but deployment succeed

Strange stuff, guys. CF Pages build command has failed (which is fine, there is indeed a problem). But CF build process proceeded with the release, indicating success.

We are yet to debug the build process, but our command ends with status code 1, which should be enough to make it fail.

Any ideas?

16:19:21.875	error error: Error: [node] [graphql] [sanity] Failed to fetch context data sanityFindStorePage
16:19:21.875	    at c (/opt/buildhome/repo/.cache/compiled/gatsby-node.js:1:194999)
16:19:21.875	    at processTicksAndRejections (node:internal/process/task_queues:95:5)
16:19:21.875	    at async Promise.all (index 43)
16:19:21.875	    at Object.Jt (/opt/buildhome/repo/.cache/compiled/gatsby-node.js:1:11623)
16:19:21.875	    at runAPI (/opt/buildhome/repo/node_modules/gatsby/src/utils/api-runner-node.js:509:16)
16:19:22.354	not finished createPages - 8.387s
16:19:22.879	info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
16:19:22.879	error Command failed with exit code 1.
16:19:23.335	Finished
16:19:23.336	Note: No functions dir at /functions found. Skipping.
16:19:23.336	Validating asset output directory
16:19:24.285	Deploying your site to Cloudflare's global network...
16:19:26.979	Uploading... (11/11)
16:19:26.980	✨ Success! Uploaded 0 files (11 already uploaded) (0.75 sec)
16:19:26.980	
16:19:27.975	✨ Upload complete!
16:19:29.040	Uploading to build output cache
16:19:29.425	Success: Build output uploaded to build cache.
16:19:30.330	Success: Assets published!
16:19:32.259	Success: Your site was deployed!
1 Like

We’re facing the same issue with our Gatsby site. Build command exits with status 1 but Cloudflare Pages declares the build as a success and deploys the broken build artifacts.

This is probably the same issue: Gatsby build fails with exit code 1, but deploy starts and finishes, rendering our app 404

1 Like