SVGs not rendered in 0.43

When using hugo server in version 0.43 all pages fail to render SVGs but all other image types (JPG, PNG etc.) render as normal. Downgrading to 0.42.2 has solved this issue.

The src of all images is correct but when attempting to right click and image and view it or open it in a new tab, it instead attempts to serve it as a file download.

Has this been an issue anyone else has encountered or could I be missing something very obvious that is totally unrelated to Hugo?

This is a known bug and will be fixed with the next release. https://github.com/gohugoio/hugo/issues/4920

2 Likes

I did search the GitHub issues but hadn’t checked closed issues. My mistake. Thank you for your reply.

Please see 0.44 release @Tikon :

In Version 0.43 the SVG images rendered correctly. After the update to version 0.44 the SVG images become only placeholders.

@Joerg I suggest you check/reset your browser cache or something, because Hugo server in Hugo 0.44 does serve SVGs with the correct MIME type.

I cleaned the cache. But without success. The images are in /themes/themename/static/images

Then you probably need to check your browser. 0.43 delivered wrong MIME for SVG. 0.44 is correct.

I checked a site on which I use svg with .44, and there’s no problem, by way of comparison.

It works fine. I cleaned the cache und started hugo server agian. Sorry and thank your for your help.

1 Like