Responsive Image srcSet returning an invalid image URL

I uploaded an 44x18px png image, file size 1.04KB. The image uploaded correctly but the responsiveImage srcSet is of the form https://www.datocms-assets.com/99106/1718013153-avid-light-blue.png 44w. This produces an invalid image when displayed in html.
Screenshot 2024-06-10 at 11.16.57

Hey @ifeanyi.dike,

Welcome to the DatoCMS forum! What are you trying to do, exactly? Can you please share some sample code?

A srcset is generally meant to be used with responsive images: Responsive images - Learn web development | MDN, e.g.

(from https://codesandbox.io/p/sandbox/datocms-img-srcset-rl243v?file=%2Findex.html%3A6%2C47)

If you only need one size, you should use the src field instead of srcSet. If you need to make that one image 44 pixels wide coming back from Imgix, you can either use the imgixParams in GraphQL:

Or you can append Imgix URL parameters directly to the image URL, like https://www.datocms-assets.com/99106/1718013153-avid-light-blue.png?w=44

Does that help? If that doesnโ€™t answer your question, could you please post some sample code (but the GraphQL or CMA data youโ€™re fetching and your frontend code) and explain what youโ€™re trying to do?

1 Like

Thank you

1 Like