#Cloudlare adapter -> cloudflare imageService, images 404 in ssr

11 messages ยท Page 1 of 1 (latest)

jovial nexus
#

Hello - first time visitor. I am doing a small side project using astro and it is soooo much fun after working on big react app at work every day. Thank you for this great project.
To my question - I am hosting my project on cloudflare pages. Most of the routes are pre-rendered and there all works super, but there are a few where I would like to use ssr. So understanding that I can't use compile as image service I set it up to 'cloudflare'. I bought the 5 EUR/ a month Cloudflare Images option so that they can be stored and resized there, but the server generated images don't work.
I get a 404 for an url https://astro-cloudflare-image-latest.pages.dev/cdn-cgi/image/width=2000,format=webp/_astro/bird.DdPxpCJ0.jpg (I use a Picture element) and info there that the image can not be shown because it contains errors.
What am I missing?
I made a simplified case in a repo:
https://github.com/halas/astro-cloudflare-image-latest/tree/main

Thank you in advance for your help ๐Ÿ™‚

GitHub

test repo to debug astro cloudflare image transforms - halas/astro-cloudflare-image-latest

solid path
#

Let me quickly look at this ๐Ÿ™‚

#

First make sure that you have it enabled on your domain. I also see that you linked the pages.dev url, that doesn't work by default.. I'm searching for the Cloudflare forum, but to get it working with pages.dev url you need to setup some redirects

jovial nexus
#

thank you for having a look

#

that already cleares things up ๐Ÿ™‚ I was using pages.dev while in development, did not think that I need a domain to make it work

solid path
#

Yeah that info is hidden in their docs, somewhere. I can't find the forum post, but you might be able to find it with something like /cdn-cgi/image not working with dev urls...

jovial nexus
#

thank you ๐Ÿ™‚ That is what I will do.

jovial nexus
#

indeed with a domain works without a problem. Cloudflare is great but sometimes the jungle of their product and documentation can get confusing ๐Ÿ™‚ I was thinking initially that maybe it would make sense to suggest some addition to the astro cloudflare adapter docs, but maybe it makes more sense on the cloudflare side - will make a PR there

solid path
#

feel free to open a pr for our docs

#

maybe something like this