Hi everyone, I think this is the right place to post this. I'm currently in the process or migrating

Hi everyone, I think this is the right place to post this. I'm currently in the process or migrating from Vercel to Pages, and everything has going super smooth so far, apart from Image optimization. I use the /cdn-cgi custom loader from the dev docs:

const normalizeSrc = src => {
  return src.startsWith('/') ? src.slice(1) : src;
};

export default function cloudflareLoader ({ src, width, quality }) {
  const params = [`width=${width}`];
  if (quality) {
    params.push(`quality=${quality}`);
  }
  const paramsString = params.join(',');
  return `/cdn-cgi/image/${paramsString}/${normalizeSrc(src)}`;
};

but all optimized images return a 404 (example below)

source image (works fine):
https://summit7-media.pages.dev/splash.png

optimized image (404 error):
https://summit7-media.pages.dev/cdn-cgi/image/width=96/splash.png


is there anything I am doing wrong here? Any and all help appreciated!
Was this page helpful?