Astro project no longer showing svg images

  • My svg images are no longer working on Netlify.
  • My site is at preneurguide.netlify.app
  • You can see an example here: Welcome to the Preneur Guide | Preneur Guide
  • The site has a custom domain of preneurguide.com, but that doesn’t seem important
  • The build is fine and it behaves as expected locally
  • Things were working fine Wednesday; I noticed a problem last night and it continues today.
  • I republished a minor patch (Astro 4.15.4 to 4.15.5) to see if a republish would resolve the issue, but the issue remains.
  • An example request is: https://www.preneurguide.com/.netlify/images?url=_astro%2Fundraw_startup_life_re_8ow9.DYWGXAX6.svg
  • Chrome (Developer Tools) shows that it responded with a 200, but the Preview does not show the image.
  • A manual wget shows that the request seems to work – I get the svg payload.

I did some more digging and realized that the content-type looks incorrect. It is image/svg instead of image/svg+xml.
I notice that if I open the svg image in the browser it prompts me to download the file instead of displaying the image.
Looks like a bug.

FYI: To workaround the issue, I disabled the imageCDN:

  adapter: netlify({
    imageCDN: false,
  }),

You should now be able to enabled the Image CDN.

@hrishikesh This is happening to my Next.js projects as well. All svgs in an image tag are broken. Everything was working fine the other day. Is there a fix besides the workaround that @AnthonyW did?

Hi @s8webteam,

Thanks for reaching out and welcome to Netlify’s Support Forums!

Could you let us know the sitename.netlify.app name or the custom domain? We’ll then add the custom domain to a feature flag which should resolve the issue.

@Melvin https://station8-fluid-development.netlify.app/

I have 2 other sites with the same problem, so let me know if you need those too. Thanks!

Hi @s8webteam,

Thank you for following up. I’ve added station8-fluid-development.netlify.app to the feature flag. If you could let me know the other two sites, I’ll add them as well. Let us know if you’re still seeing issues on the station8-fluid-development.netlify.app site. Thanks!

@Melvin

Here are the other two:

I did a temporary fix on the parnel site where I just hard coded the svgs since it’s a live site.

The station8-fluid-development.netlify.app is fixed now, thank you!

What do you mean by “feature flag”. Is there anything I can do to fix this or can you explain why this started happening all of a sudden?

Hi @s8webteam,

Thanks for following up.

I’ve added the two sites you mentioned above to the feature flag on our end. This isn’t something you can do on your end. Please let us know if this isn’t resolved for you on your sites.

@Melvin

https://parnelbiogas.com/ - Is working now, but https://station8-oce-development.netlify.app/ isn’t.

Is there a reason why this occurring?

@Melvin

I forgot I also had this site that is having the same problem too.

https://station8-oai-development.netlify.app/

Hi @s8webteam,

Apologies for the delay. I’ve added station8-oai-development.netlify.app and re-added station8-oce-development.netlify.app to the feature flag. Can you let me know if they are working? When I originally added station8-oce-development.netlify.app I didn’t realize the https:// was included and I believe that may be why it wasn’t working. I’ve fixed that and ensured that none of the domains include https:// when added to the feature flag.

@Melvin

Yes, they are all working again. Thank you!

Is there a reason why this was happening and is there anyway to prevent it from happening again?

@Melvin already answered your question @s8webteam here:

@hrishikesh thanks for the steer.

From what I read of this, the issue can only be resolved by a Netlify engineer changing some setting for the user, is that correct? If so, could I please PM you the sites that require SVG’s to be enabled?

If you must send a PM, sure. Or you can just drop your site ID here.

Thank you, @hrishikesh , here are the site IDs we would like SVGs to be enabled to be served from the image CDN:

  • 254d2912-4e29-4337-921c-84235b5215e7
  • e0d29c66-5a53-433a-9a33-912741d71b31
  • bf268780-6aa2-4156-9f6e-9662245fc5e5
  • b8b95565-349a-46bc-96db-6079ab48099b
  • e0efd593-ff6c-42b1-a132-0ccc2099f7cb
  • 567e105e-8d9f-41d1-82a8-01b144ffcda8

Excluded your entire account from the change.

1 Like

Thanks very much, we’ll test that and report back should we have any issues.

Same on my site 637d8f6c-3308-46fd-af2e-033491b4c219 (benyoung.blog) - have disabled CDN in adapter for now