[gatsby-plugin-image] Defaults for formats
are being ignored
#29828
Labels
type: bug
An issue or pull request relating to a bug in Gatsby
formats
are being ignored
#29828
Description
As mentioned in these pull requests (/pull/29147, /pull/29564), defaults for
gatsby-plugin-image
can be set as follows:gatsby-config.js
The defaults for
formats
are being ignored.Reproduction
Follow the steps below or refer to this reproduction on CodeSandbox:
Start with
gatsby-starter-default
.gatsby-config.js
src/components/image.js
Behaviors
Expected
The
formats
provided in the defaults (which is["avif", "webp"]
) should be used by theGatsbyImage
and / orStaticImage
components.Actual
On inspecting the generated HTML with Dev Tools, the
<picture>
tag doesn't have an image withAVIF
format.It seems that the plugin default
formats
(which is["auto", "webp"]
) is used instead.When explicitly setting the
formats
to["avif", "webp"]
fromgraphql
query, the<picture>
tag has an image withAVIF
format.Environment
gatsby info
on CodeSandboxThe text was updated successfully, but these errors were encountered: