Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable sharp libvips cache. #10616

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/thin-seahorses-whisper.md
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 3 additions & 0 deletions packages/astro/src/assets/services/sharp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down