Filtered document lists showing error on load

5 replies
Last updated: May 29, 2024
I'm seeing a regression where filtered document lists are now showing this when loaded:
AI Update

I can see you're experiencing an issue with filtered document lists in Sanity Studio, but your question appears to have been cut off - you mentioned they're "showing this when loaded:" but didn't include what's actually being displayed. However, I can help you with the most likely culprit based on recent changes.

The most common cause right now is the API perspective change:

On February 24, 2025, Sanity released API version 2025-02-19 which includes a breaking change: the default perspective switched from raw to published. This means:

  • Filtered document lists now only show published documents by default
  • Draft documents (including those with drafts. prefix) won't appear unless you explicitly set the perspective
  • If you were filtering for drafts or expecting unpublished content, your lists may now appear empty

To fix this in your Structure Tool configuration:

S.documentList()
  .title("Your Filtered List")
  .filter('_type == "yourType" && yourCondition')
  .apiVersion('2024-01-01') // Use an older API version

Or if you want to see drafts with the new API version, you'll need to adjust your filter to account for the perspective change, or configure your Structure Tool to use perspective=raw or perspective=previewDrafts.

Other things to check:

  • Browser console for error messages
  • Whether your filter query references fields that might not exist on published documents
  • If you're using query parameters (like $today), ensure they're properly defined

Can you share what's actually displaying (error message, blank screen, empty list, etc.) so I can give you more specific guidance?

Show original thread
5 replies
I updated to the latest
sanity
version and ran
sanity deploy
but it's still showing this on the sanity-hosted deployment
I can’t seem to reproduce this on
v3.44.0
when using
.filter()
on a document list. Would you be able to provide a snippet from your structure?
ah yup, so yesterday I saw updating to the latest would fix (which it did locally), but that was
v3.43.0
at the time
just updated to
v3.44.0
and redeployed and now it's working on the deployed version!
Glad to hear it! 🙌

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?