404 on /cdn-cgi/image/ when deploying Astro

I am deploying an Astro site which rewrites my image reference to be https://mydomain/cdn-cgi/image/width=512,height=512,format=webp/_astro/myimage.png This gives a 404 error when accessed. The source image /_astro/myimage.png loads as expected. Why would /cdn-cgi/image not be returning?
5 Replies
Erisa
Erisa4mo ago
Did you enable Image Transformations on the zone?
Kiwi
KiwiOP4mo ago
@Erisa I don't know. where is that config in the dashboard?
Kiwi
KiwiOP4mo ago
If you mean Image Optimizations, I'm on the free plan so don't have many options
No description
Kiwi
KiwiOP4mo ago
Actually I think I found the settings eventually after purchasing the free Images product, following a prompt to enable image optimizations on free accounts on my zone. I now get an error when requesting the image at least, instead of a browser message 404 ERROR 9412: Could not resize the image: Unknown or unsupported file type Ok, so I think it's a DX issue more than anything. 1. during setup on the cloudflare adapter in Astro config the image service was set to CF 2. the account was not configured for image transformation properly 3. when deploying the image error 404ed with no logs in the tail I still can't get the images to work though e.g. https://865f31bc.firebucket-web.pages.dev/cdn-cgi/image/width=512,height=512,format=webp/_astro/bucket.-H8ZBVPz.png
Erisa
Erisa4mo ago
really annoyingly image resizing only works on custom domains that have the feature enabled not pages.dev
Want results from more Discord servers?
Add your server