
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI feel your pain – this is a classic case of data getting into a state that breaks Studio's UI. The good news is you have several ways to fix this without nuking your entire dataset!
The fastest solution is to delete the problematic document using the Sanity CLI or client library. Here are your options:
Using the Sanity CLI:
sanity documents delete <document-id>You'll need the document ID, which you should be able to see in the URL or list view even if you can't open the document itself.
Using the JavaScript client:
import {createClient} from '@sanity/client'
const client = createClient({
projectId: 'your-project-id',
dataset: 'your-dataset',
token: 'your-token-with-write-access',
apiVersion: '2024-01-01',
useCdn: false
})
client.delete('document-id')
.then(() => console.log('Document deleted'))
.catch(err => console.error('Delete failed:', err))If you want to salvage the document rather than delete it, you can use a patch operation to fix the broken field. Since you called an object where you should have called an array, you need to set that field to an empty array (or the correct array value):
client
.patch('document-id')
.set({ 'yourFieldName': [] }) // Replace with your actual field name
.commit()
.then(() => console.log('Document fixed'))
.catch(err => console.error('Patch failed:', err))If the field is nested, use dot notation like 'parentField.childField': []. The Patches documentation has more examples of targeting specific fields in complex documents.
If you can see the document in the list view but can't open it, try:
*[_type == "your-post-type"] | order(_updatedAt desc) [0...10]If other documents reference this broken one and you're having trouble deleting it, the CLI delete command supports a --force parameter to delete documents even when they have strong references pointing to them. Be careful with this as it will break those references.
This error happens because Studio's ArrayInput component is trying to call .some() on a value that isn't an array – exactly what you suspected. Once you either delete the document or patch the field to be a proper array, you should be back in business!
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