Issue with block content editor resolved by updating Sanity Studio
I can see you're hitting the "Could not validate the resulting portable text to insert" error when pasting images. Your schema looks correct, so let's troubleshoot this systematically.
Check Your Sanity Version First
The ability to paste images directly into the Portable Text Editor is a relatively recent feature. Before diving into other causes, check what version of Sanity you're running:
npm list sanityIf you're on an older version of Studio v3, updating might resolve the issue:
npm install sanity@latestThen restart your dev server. The Portable Text Editor has received numerous improvements for paste and drag-and-drop functionality in recent releases, and older versions may not properly handle pasted image content.
Your Schema Looks Correct
Based on the Portable Text documentation and Block Content guide, your schema structure is valid. The image block definition with custom fields (alt, wide, background) follows the standard pattern for custom blocks in the of array. The fact that a similar schema works in your other studio confirms this approach is sound.
Other Things to Check
Compare with your working studio:
- The exact Sanity version numbers (minor versions can matter)
- Any plugins in the
pluginsarray ofsanity.config.tsthat might affect the editor - Whether there are any custom
componentsor configuration on the array field itself - Asset source configuration that might restrict uploads
Browser and environment:
- Try copying the image from a different source
- Test in a different browser
- Check the browser console for additional error messages beyond the validation error
- Verify clipboard permissions aren't being blocked
Schema validation:
- Make sure there are no conflicting schema definitions for
richTextor image types elsewhere - Verify the schema compiles without errors (
sanity schema extract)
Workarounds While Troubleshooting
While you investigate, you can still add images using:
- The "+" button or toolbar in the editor to insert images through the UI
- Drag and drop image files directly into the editor (this uses a different code path than paste)
- The image button if you've configured one in your editor toolbar
The validation error suggests the editor is receiving the pasted content but rejecting it during the validation phase. This is most commonly caused by version differences - the paste handling code has evolved significantly across Studio v3 releases. Since you have a working studio with similar schema, comparing the exact package versions between the two projects would be my first debugging step.
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.