Closed claygiffin closed 3 years ago
Thanks for the details, we'll take a look at this shortly!
Alright, we've released v2.6.14 which fixes the issue with JPEG images. It is correct that we only return a fallback
without sources
though, because we leverage the ?auto=format
Imgix parameter that automatically returns webp when the browser supports it, so we don't need multiple sources and a picture
tag.
I am getting the following console error when I pull gatsbyImageData for non-jpg images:
Looking at gatsbyImageData queries for jpg vs non-jpg (tested .jpeg and .webp images) gave the following results:
JPG Output
In this case, JPGs are missing their sources, and are relying on the fallback. When using the
<GatsbyImage>
component, this displays the image using<img src="..." srcset="...">
instead of<picture>
JPEG Output
Now we have our source array, but it is missing the "src" entry, as well as the fallback. When using
<GatsbyImage>
component, this displays the image using<picture>
as expected. However, the<img>
element nested inside is missing its "src" attribute, giving us the reported error.