User resolves image selection issue caused by CSS customization
It sounds like you're experiencing an issue where you can upload images successfully, but when you try to select existing images from the asset library, nothing happens. This is a frustrating problem, especially when there are no error messages to guide you.
Based on similar issues in the Sanity community, here are the most common causes and solutions:
Check your metadata configuration
The most common cause of image-related issues in Sanity Studio is invalid metadata configuration. According to this resolved issue, certain metadata values can cause problems.
In your image field schema, check if you have a metadata array in the options. Remove dimensions, hasAlpha, and isOpaque if they're present, as these are not valid metadata options and can cause the image picker to fail silently. The valid metadata options are:
blurhashlqippaletteexiflocation
Your image field should look like this:
{
name: 'myImage',
type: 'image',
options: {
metadata: [
'blurhash',
'lqip',
'palette',
'exif'
]
}
}Other troubleshooting steps
Clear your browser cache and Studio cache - Sometimes the Studio can get into a weird state. Try:
- Hard refresh your browser (Ctrl+Shift+R or Cmd+Shift+R)
- Clear your browser's local storage for the Studio
- Restart your Studio development server
Check browser console more carefully - Even if you don't see errors initially, open the Network tab in your browser's developer tools when you try to select an image. Look for any failed requests (400, 401, 403, or 500 errors).
Test in incognito/private mode - This rules out browser extensions or cached data causing issues.
Update Sanity Studio - If you're not on the latest version, update with
npm install sanity@latest. There have been several fixes for image-related issues over time.Check your schema for custom input components - If you have any custom input components for your image fields, make sure they're properly implementing
React.forwardRef()as required by Sanity.Verify asset permissions - Make sure your project has the proper permissions set up for accessing assets. Check your project settings in manage.sanity.io.
If none of these solve the issue, it would be helpful to share your complete image field schema and any custom components you might be using. You can also get real-time help in the Sanity Community Slack where the team and community members can help debug further!
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.