
Grab your gear: The official Sanity swag store
Read Grab your gear: The official Sanity swag storeI understand your frustration - this error is indeed preventing you from publishing, and it's a referential integrity issue that needs to be properly resolved. Let me explain what's actually happening and provide you with real solutions.
The error message tells you that document 69ebe839-9dd3-4e9b-be38-0da662df7973 contains a strong reference pointing to your draft (drafts.4d463db7-9140-46d0-94b4-2801c195c202). When you try to publish, Sanity attempts to delete the draft document (as part of the normal publish process), but strong references enforce referential integrity - they prevent deletion of documents that other documents depend on.
This is blocking your publish operation completely.
Someone created a reference to your draft document instead of the published version. This typically happens when:
_weak: trueThe cleanest approach is to update document 69ebe839-9dd3-4e9b-be38-0da662df7973 to reference the published version instead:
69ebe839-9dd3-4e9b-be38-0da662df7973 in your Studio4d463db7-9140-46d0-94b4-2801c195c202If you need to do this for multiple documents, you could write a migration script to update all references from drafts.4d463db7-9140-46d0-94b4-2801c195c202 to 4d463db7-9140-46d0-94b4-2801c195c202.
As explained in the Sanity weak references documentation, weak references allow documents to be deleted even when other documents reference them. However, simply adding weak: true to your schema won't fix existing data.
You need to:
{
name: 'myReferenceField',
type: 'reference',
to: [{type: 'yourDocumentType'}],
weak: true // This only affects NEW references
}_weak: true:// Example migration using Sanity client
const doc = await client.getDocument('69ebe839-9dd3-4e9b-be38-0da662df7973')
// Find the reference field and update it
const updatedDoc = {
...doc,
yourReferenceField: {
_type: 'reference',
_ref: 'drafts.4d463db7-9140-46d0-94b4-2801c195c202',
_weak: true // Add this property
}
}
await client.createOrReplace(updatedDoc)If the reference isn't critical:
69ebe839-9dd3-4e9b-be38-0da662df7973If you suspect this affects hundreds of pages, you can use GROQ to find all documents referencing your draft:
*[references("drafts.4d463db7-9140-46d0-94b4-2801c195c202")]Run this in the Vision plugin in your Studio to see the full scope of the issue.
To prevent references to drafts, add a filter to your reference fields in the schema:
{
name: 'myReferenceField',
type: 'reference',
to: [{type: 'yourDocumentType'}],
options: {
filter: '!(_id in path("drafts.**"))' // Only allow published documents
}
}Sanity doesn't offer a force publish option because it would create broken references throughout your dataset, violating data integrity. The system is protecting you from creating orphaned references that would cause issues downstream.
The good news is that once you fix the referencing document(s) using one of the solutions above, your publish should work normally.
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