
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI feel your pain with this singleton bug! Unfortunately, based on the information from the Sanity team, if a document was created or updated during the period when that regression was active, upgrading to version 2.21.9 alone won't automatically fix it. The document itself has corrupted _type metadata that persists even after the Studio fix.
The bad news is that these affected documents do need to be deleted and recreated. The good news is there are a couple of approaches to minimize the pain:
Option 1: Export, Edit, and Re-import (Recommended)
This approach from Sanity's support team lets you preserve your content:
sanity dataset export <dataset> <filename>.tar.gztar -xzf <filename>.tar.gz (Mac/Linux)<folder-that-was-untarred>/data.ndjson in your editor_type to the correct value. Copy the _idsanity documents delete <_id> (add --dataset=<dataset> if needed)tar -czf <new-filename>.tar.gz <folder-that-was-untarred>sanity dataset import <new-filename>.tar.gz <dataset> --replaceImportant: Test this on a non-production dataset first if possible!
Option 2: Use the HTTP API
You can also copy the document's JSON and create a new document with the correct _type using the HTTP Mutations API before deleting the old one. This gives you more control but requires writing some code.
The core issue is that the _type field in the stored document doesn't match what the Studio expects for that singleton, and there's no automatic migration path. The fix in 2.21.9 prevents new documents from getting corrupted, but doesn't heal existing ones.
If you have multiple affected documents, scripting the export/edit/import process would definitely save time over doing it manually!
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.
Content operations
Content backend


The only platform powering content operations
By Industry


Tecovas strengthens their customer connections
Build and Share

Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag store