diff --git a/.changeset/thin-seahorses-whisper.md b/.changeset/thin-seahorses-whisper.md new file mode 100644 index 0000000000..c11b11ecdd --- /dev/null +++ b/.changeset/thin-seahorses-whisper.md @@ -0,0 +1,7 @@ +--- +"astro": patch +--- + +This change disables the `sharp` `libvips` image cache as it errors when the +file is too small and operations are happening too fast (runs into a race +condition) diff --git a/packages/astro/src/assets/services/sharp.ts b/packages/astro/src/assets/services/sharp.ts index 59a461c6eb..2493c53017 100644 --- a/packages/astro/src/assets/services/sharp.ts +++ b/packages/astro/src/assets/services/sharp.ts @@ -32,6 +32,9 @@ async function loadSharp() { throw new AstroError(AstroErrorData.MissingSharp); } + // Disable the `sharp` `libvips` cache as it errors when the file is too small and operations are happening too fast (runs into a race condition) https://github.com/lovell/sharp/issues/3935#issuecomment-1881866341 + sharpImport.cache(false); + return sharpImport; }