Sanity Studio publishes but queries return outdated content (old _updatedAt)

116 replies
Last updated: Dec 1, 2025
Hi Team,
we are facing an issue that is blocking the production of our corporate website

it's a project involving Sanity Studio + NextJs

it has always worked perfectly

but suddenly we are not able to publish new content (at least from last week)

no errors or warnings are returned by the Studio

Here are the steps to reproduce the issue:

1 - updated a field in a document and published the change

https://files.slack.com/files-pri/T9Y440GN8-F041N6HTDLM/new-content.png 2 - schema is correctly updated

https://files.slack.com/files-pri/T9Y440GN8-F041R5NSVJ6/schema.png 3 - query (in Vision panel) returns an old version of the document without latest changes,
please notice the outdated '_updatedAt' value

https://files.slack.com/files-pri/T9Y440GN8-F041R5Q64H0/query-01.png
https://files.slack.com/files-pri/T9Y440GN8-F041N6LCJ2Z/query-02.png On the NextJs side

4 - query result is the same as in Vision (outdated)

https://files.slack.com/files-pri/T9Y440GN8-F041R5RCZ34/no-preview-mode.png
5 - new content is correctly displayed in Preview Mode only

https://files.slack.com/files-pri/T9Y440GN8-F042ES92Q8G/preview-mode.png
Can you please help us to figure out what's going on and a possible fix?
We have a bunch of resources blocked on this (devs, qa, editors) since days
and it's starting to have a very bad impact on the economic metrics of our company

Thanks!
AI Update

I understand this is a critical production issue. Based on your symptoms, here are the most likely causes and solutions:

Most Likely Cause: API Perspective Configuration

The behavior you're describing—where content appears in preview mode but not in Vision or production queries—strongly suggests a perspective mismatch in your queries.

When you publish a document in Studio, it creates a published version. However, if your queries are using the wrong perspective, they might not be retrieving the published content correctly.

Immediate Diagnostic Steps

1. Check your API version and default perspective

If you recently updated your @sanity/client or API version, this could be the culprit. Note that API version updates require explicit opt-in—projects don't automatically upgrade to new API versions.

2. Verify in Vision

In the Vision tool, explicitly test with different perspectives. Add this to your query parameters:

{"perspective": "published"}

Then try:

{"perspective": "raw"}

Compare the results. If raw shows your updated content but published doesn't, there's an issue with how the document is being published.

3. Check the document ID directly

In Vision, query for both the draft and published versions:

*[_id == "YOUR_DOCUMENT_ID"]

and

*[_id == "drafts.YOUR_DOCUMENT_ID"]

This will show you if both versions exist and their respective _updatedAt timestamps.

Potential Causes & Solutions

1. Content Releases (If You're on Growth Plan or Above)

If your organization is on a Growth or Enterprise plan, someone may have enabled Content Releases. When this feature is active, clicking "Publish" doesn't immediately publish—it adds changes to a release bundle instead.

How to check:

  • Look for a "Releases" section in your Studio navigation
  • If you see an active release containing your changes, you need to publish that release itself

How to fix:

  • Navigate to Releases in Studio
  • Find the active release
  • Publish/apply the entire release

2. CDN or API Caching Issue

While less likely (since Vision queries the API directly), there could be a cache invalidation problem.

How to check:

  • Add ?nocache=true or a random query parameter to your Vision queries
  • Check if the _updatedAt timestamp matches what you see in the document inspector

3. Client Configuration in Next.js

Your Next.js client might be configured with an incorrect perspective or caching settings.

Check your Sanity client setup:

// Make sure your client is configured correctly
const client = createClient({
  projectId: 'your-project-id',
  dataset: 'your-dataset',
  apiVersion: 'your-api-version',
  useCdn: false, // Try setting this to false temporarily
  perspective: 'published', // Explicitly set this
})

For preview mode, you should be using perspective: 'previewDrafts'.

Immediate Action Plan

  1. Check for Content Releases first - This is the most common cause of this exact symptom pattern. Look in your Studio navigation for a "Releases" section.

  2. Verify your API client configuration - Ensure useCdn: false temporarily to rule out CDN issues

  3. Test with explicit perspectives - Use Vision to confirm which perspective returns correct data

  4. Check recent configuration changes - Review any recent updates to sanity.config.ts, sanity.cli.ts, or your Next.js client setup

If Nothing Works

If none of the above resolves the issue:

  1. Check your dataset transaction history to confirm the publish action actually occurred
  2. Contact Sanity support directly through the help chat in your project dashboard—they can check server-side logs
  3. Try creating a completely new test document and publishing it to see if the issue is document-specific or system-wide

The fact that preview mode works correctly is actually good news—it means your data is there and your Studio is functioning. This is almost certainly a configuration or perspective issue rather than data loss or a platform bug.

Show original thread
116 replies

Sanity – Build the way you think, not the way your CMS thinks

Sanity is the developer-first content operating system that gives you complete control. Schema-as-code, GROQ queries, and real-time APIs mean no more workarounds or waiting for deployments. Free to start, scale as you grow.

Was this answer helpful?