Hello,
I am trying to set up some automated checks for my astro/starlight site which include a build step. The build step works on my local system (macos 14.2.1) as well as on my remote server (Ubuntu 22.04) but when it runs via Github Actions it errors out with the following error:
[NoImageMetadata] Could not process image metadata for `/home/runner/work/starlight-image-error/starlight-image-error/src/assets/test.webp`.
Hint:
This is often caused by a corrupted or malformed image. Re-exporting the image from your image editor may fix this issue.
Error reference:
https://docs.astro.build/en/reference/errors/no-image-metadata/
Stack trace:
at imageMetadata (file:///home/runner/work/starlight-image-error/starlight-image-error/node_modules/astro/dist/assets/utils/metadata.js:6:11)
at async Object.transform (file:///home/runner/work/starlight-image-error/starlight-image-error/node_modules/astro/dist/content/runtime-assets.js:7:24)
at async file:///home/runner/work/starlight-image-error/starlight-image-error/node_modules/zod/lib/index.mjs:2560:29
at async file:///home/runner/work/starlight-image-error/starlight-image-error/node_modules/zod/lib/index.mjs:2267:32
at async ZodObject.safeParseAsync (file:///home/runner/work/starlight-image-error/starlight-image-error/node_modules/zod/lib/index.mjs:677:24)
Error: Process completed with exit code 1.
Here is my reproduction repo. Emphasis was made on removing essentially everything else while still getting the error on Github Actions. As you will see it is very bare bones.
I have done everything under the sun I feel like to resolve this. It errors on any image, I have tried new images, re-exporting images, new image files, different node versions, different ubuntu versions, different sharp versions. So I am quite lost.
Please feel free to ping me if needed!