0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-27 22:19:04 -05:00

Disable sharp libvips cache. (#10616)

* Disable `sharp` `libvips` cache.

* Update sharp.ts

* Add changeset

* Apply suggestions from code review

* Add issue to comment in sharp.ts

---------

Co-authored-by: Emanuele Stoppa <my.burning@gmail.com>
This commit is contained in:
Nikola R. Hristov 2024-04-03 13:11:58 +03:00 committed by GitHub
parent 8db630c3b4
commit 317d18ef8c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 0 deletions

View file

@ -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)

View file

@ -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;
}