Project not being built with most recent CMS changes

Hi! On this project we’ve got a build hook on Netlify that is being called by a CMS - Sanity - each time a document is updated / created / deleted. The build hook is called almost immediately but the build results are outdated in terms of the published CMS changes.

I’ve already tested this dozens of times, in different browsers, incognito mode, logging back in to Sanity, clearing Netlify’s cache, etc. and up to now the only thing that works is deploying the website one more time (manually) after the build hook is called on Sanity’s side. The build results are always relative to the last but one build if this isn’t done manually.

https://626176540645b6050a64cace--malarianomore.netlify.app/ is one of the deploy URLs
Project name: malarianomore

build settings:

[build]
  base = "/"
  publish = ".next"
  command = "yarn build"
  ignore = "git diff --quiet HEAD^ HEAD . ../yarn.lock"

[build.environment]
  NEXT_PUBLIC_SANITY_TOKEN = "..."
  NODE_ENV = "production"

[[plugins]]
package = "@netlify/plugin-nextjs"

Solution was to disable Sanity’s use of their own CDN (useCdn: true on their config file)

1 Like

Thanks for following up and letting us know your solution! This will definitely benefit future forums members who encounter something similar. Happy building :rocket: