Hey everyone! đź‘‹
We’re running into an issue where publishing in Payload CMS sometimes results in a partial Gatsby build, causing pages or images to disappear. After some investigation, we found that clearing caches in both Payload and Gatsby in Netlify before rebuilding resolves the issue—but we’re trying to understand the root cause and find a proper fix.
The problems means everytime we publish anything our deploy breaks and we receive a busted production website until we clear all caches and rebuild.
Project Setup
- CMS Backend: Payload CMS (deployed on Netlify)
- Website Frontend: GatsbyJS (deployed on Netlify)
- Content Syncing: Using
gatsby-source-payloadto pull content from Payload CMS into Gatsby - Storage: S3 storage plugin + RDS/Postgres
- Build Triggers:
- Publishing in Payload CMS triggers a Gatsby rebuild.
- Merging to
mainin our monorepo triggers a Payload and Gatsby rebuild.
Issue Description
- After a fresh, clean build of both payload and website, the website is fine—all content loads correctly.
- After publishing a page in Payload CMS, Gatsby does not fetch all content during the next rebuild.
- Missing elements include:
- Some blog posts disappearing.
- Some (or all) images not appearing.
- Occasionally, full pages missing.
- There are no errors in logs