Search code examples
next.jssanity

NextJS/Sanity: Error: Failed to collect page data


I have a local repo of a live NextJS/Sanity website, but I've set the Sanity projectID to a different blank Sanity project to avoid overwriting the live website.

After running npm run build, I receive an error

Error: Failed to collect page data for /industries/[slug]

/pages/industries/[slug].tsx exists

Help appreciated.


Solution

  • For what it's worth, cloning the repo again and keeping the original Sanity project ID resolved the error.