diff --git a/.changeset/tough-doors-shop.md b/.changeset/tough-doors-shop.md new file mode 100644 index 000000000..738561466 --- /dev/null +++ b/.changeset/tough-doors-shop.md @@ -0,0 +1,5 @@ +--- +'@astrojs/image': patch +--- + +Log error if failed to fetch remote image diff --git a/packages/integrations/image/src/build/ssg.ts b/packages/integrations/image/src/build/ssg.ts index 2382797c1..9a18b1a70 100644 --- a/packages/integrations/image/src/build/ssg.ts +++ b/packages/integrations/image/src/build/ssg.ts @@ -73,7 +73,8 @@ async function loadRemoteImage(src: string) { data: Buffer.from(await res.arrayBuffer()), expires: Date.now() + expires, }; - } catch { + } catch (err: unknown) { + console.error(err) return undefined; } } diff --git a/packages/integrations/image/src/endpoint.ts b/packages/integrations/image/src/endpoint.ts index 872403226..06599a7ea 100644 --- a/packages/integrations/image/src/endpoint.ts +++ b/packages/integrations/image/src/endpoint.ts @@ -14,7 +14,8 @@ async function loadRemoteImage(src: URL) { } return Buffer.from(await res.arrayBuffer()); - } catch { + } catch (err: unknown) { + console.error(err) return undefined; } }