Upgrading to the latest version of Sanity may fix a desk crash issue when deleting a single item from a gallery.
This sounds frustrating! While your gallery schema looks perfectly fine, Studio crashes when deleting array items (especially images) can happen for a few reasons. Let me walk you through the most common causes and solutions:
Most Common Causes:
Outdated Studio version - Array handling has had several bug fixes across Studio versions. Make sure you're running the latest version of the
sanitypackage:npm update sanityThen restart your dev server.
Browser cache/state corruption - Sometimes Studio's local state gets corrupted:
- Hard refresh (Cmd/Ctrl + Shift + R)
- Clear browser cache and local storage for your Studio URL
- Try in an incognito/private window
Invalid metadata configuration - If you've customized your image field with metadata options, check your configuration. According to the image metadata documentation, the valid options for the
options.metadataarray are:image,exif,location,lqip,blurhash, andpalette.Note that
dimensions,hasAlpha, andisOpaqueare always included automatically and should NOT be added to the metadata array - including them will throw an error. Make sure your schema doesn't look like this:// ❌ INCORRECT - will cause errors { name: "gallery", type: "array", of: [{ type: "image", options: { metadata: ['dimensions', 'isOpaque'] // Don't do this! } }] }Plugin conflicts - If you have custom plugins or older third-party plugins, they may not handle array mutations properly. Try temporarily disabling plugins to isolate the issue.
Debugging Steps:
- Open your browser console (F12) when the crash happens - look for error messages or stack traces
- Check your terminal where Studio is running for server-side errors
- Create a minimal test document with just that gallery field to see if it's schema-specific
Temporary Workaround:
Instead of using the bin icon, try:
- Click "Edit" on the array item, then use the item menu to delete
- Use the array's three-dot menu to manage items
- Manually edit the document JSON in Vision plugin as a last resort
If none of this helps, the browser console error message will be crucial for diagnosing the issue. Post it in the Sanity Slack community or search GitHub issues - the team is very responsive to crash reports and may have a specific fix for your Studio version.
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.