I am having an issue getting content from my production Sanity Studio onto my production blog. I am using Next.js v13 and Sanity v3. The site is deployed on Vercel.
When I post from both my local Sanity Studio and production Sanity Studio, it updates on my local site. It doesn't update my production site unless I redeploy my site with Vercel. I have found what seems to be the solution for everyone else but me—add revalidate
to getStaticProps
. This does not work for me. Here is my code:
export async function getStaticProps(context) {
const { slug = '' } = context.params;
const post = await client.fetch(query, { slug });
return {
props: {
post,
},
revalidate: 10,
};
}
I am not getting any errors in the console or terminal on both the local and prod sites. Just for fun, I emptied the cache and did a hard reload on the prod page, opened it in an incognito window, opened it on Firefox, Chrome, and Edge, and have sat here for about an hour hitting refresh. Is there another solution?