User resolves image selection issue caused by CSS customization

2 replies
Last updated: Dec 31, 2024
And I have another error, I can no longer select images. They are inserted when I upload them, but when I want to select one, nothing happens and I get no error in the UI or in the console.
AI Update

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:

  • blurhash
  • lqip
  • palette
  • exif
  • location

Your image field should look like this:

{
  name: 'myImage',
  type: 'image',
  options: {
    metadata: [
      'blurhash',
      'lqip', 
      'palette',
      'exif'
    ]
  }
}

Other troubleshooting steps

  1. 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
  2. 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).

  3. Test in incognito/private mode - This rules out browser extensions or cached data causing issues.

  4. 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.

  5. 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.

  6. 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!

Hi there πŸ‘‹
What version of Sanity are you using?
I found the error. I added some code to my css to block the Download of Images on my page. That was the Problem

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.

Was this answer helpful?