Bug encountered after upgrading to version 2.0.5 causing Desk tool crash on studio pages with preview imagery.
I understand you're experiencing crashes in Sanity Studio when viewing pages with image previews after upgrading from v1.150.7 to v2.0.5. The "Cannot read property palette of undefined" error is a specific issue that occurred in Studio v2 related to image metadata processing.
Immediate fixes to try:
1. Clear cached build artifacts and reinstall
The most common cause of desk tool crashes after upgrading is stale cached data:
rm -rf node_modules .sanity
npm install
sanity startThe .sanity folder contains webpack build cache that can conflict with the new version, especially for image asset handling.
2. Update all @sanity packages together
Version mismatches between core packages often cause the "palette" error. Ensure all your @sanity/* packages are at compatible v2 versions:
npm install @sanity/base@2.0.5 @sanity/desk-tool@2.0.5 @sanity/default-layout@2.0.5 @sanity/default-login@2.0.5Check your package.json - all @sanity/* packages should be at the same 2.x version number.
3. Check for incompatible plugins
Even though you removed sanity-plugin-media, other plugins may be incompatible. The "palette" property is related to image metadata, so any plugin touching images or assets needs to be v2-compatible. Look through your package.json for other plugins and verify they support Studio v2.
4. Verify your schema preview configurations
If you have custom preview configurations in your schemas, especially for documents with images, make sure they're using the correct v2 syntax for accessing image fields.
Important context: Studio v2 reached end-of-life on December 7, 2023, meaning it no longer receives security updates or bug fixes. If you're working on an active project, I'd strongly recommend migrating to Studio v3 instead of troubleshooting v2 further. V3 has better stability, modern tooling, and ongoing support.
If you share the stack trace you mentioned, I can provide more specific guidance - look particularly for which component or file is trying to access the palette property.
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.