From 43d693c3089dd8f0fe7b46618f5555d43c936cad Mon Sep 17 00:00:00 2001 From: Juraj Kapsz Date: Mon, 15 Apr 2024 10:52:39 +0200 Subject: [PATCH] fix: picture fallback check (#10783) --- .changeset/modern-mugs-raise.md | 5 +++++ packages/astro/components/Picture.astro | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/modern-mugs-raise.md diff --git a/.changeset/modern-mugs-raise.md b/.changeset/modern-mugs-raise.md new file mode 100644 index 000000000000..0796acf9f8eb --- /dev/null +++ b/.changeset/modern-mugs-raise.md @@ -0,0 +1,5 @@ +--- +"astro": patch +--- + +Fixes Picture component specialFormatsFallback fallback check diff --git a/packages/astro/components/Picture.astro b/packages/astro/components/Picture.astro index f23ab6ccce7a..6dcc50c8e1d6 100644 --- a/packages/astro/components/Picture.astro +++ b/packages/astro/components/Picture.astro @@ -45,7 +45,7 @@ let resultFallbackFormat = fallbackFormat ?? defaultFallbackFormat; if ( !fallbackFormat && isESMImportedImage(originalSrc) && - originalSrc.format in specialFormatsFallback + (specialFormatsFallback as ReadonlyArray).includes(originalSrc.format) ) { resultFallbackFormat = originalSrc.format; }