summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.changeset/modern-mugs-raise.md5
-rw-r--r--packages/astro/components/Picture.astro2
2 files changed, 6 insertions, 1 deletions
diff --git a/.changeset/modern-mugs-raise.md b/.changeset/modern-mugs-raise.md
new file mode 100644
index 000000000..0796acf9f
--- /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 f23ab6ccc..6dcc50c8e 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<string>).includes(originalSrc.format)
) {
resultFallbackFormat = originalSrc.format;
}