Using astro with netlify and rendering astro's <Image>

Hey all!

I have had a problem using astro’s on tag since adding sanity and netlify’s CLI. I have used the tag with no problems when deploying through the website. which you can see here: https://aster-test-site.netlify.app

Since adding the CLI & sanity I noticed that the path no longer works as intended, it looks like this:


however if I use the normal html img tag it works fine.

Not sure why I can’t access the path locally? I haven’t used netlify cli with astro before :slight_smile:

@nastassia I don’t work with Astro so take this with a grain of salt, but my wild guess is that it’s less likely to be related to the CLI or Sanity, and more likely to be related to Astro and the Netlify adapter:

There’s a section regarding the Netlify Image CDN support:

https://docs.astro.build/en/guides/integrations-guide/netlify/#netlify-image-cdn-support

It’s on by default and provides details for how to opt out if that’s what you want.

This adapter by default uses the Netlify Image CDN to transform images on-the-fly without impacting build times. It’s implemented using an Astro Image Service under the hood.

To opt out of Netlify’s Image CDN remote image optimization, use the imageCDN option:

Awesome!! Thank you so much. I now have to toggle the CDN when I am in local which is a bit annoying, but at least I can see what’s going on!

Thanks for you help :smile: