R2 Public Bucket: SVG Files Not Loading in <image /> Element

We are using a public bucket to allow people to access our files. It serves as general storage where users can upload all kinds of images, including SVGs. When people include these image paths using the <image /> element, all image types work fine except for SVGs. For some reason, SVGs are not displaying, they just appear blank. There are no errors in the console, and the returned content type is image/svg+xml, which seems correct, but the preview remains blank. This issue only affects SVGs, and we are not handling them in a way that would prevent them from displaying. The R2 CORS settings allow all origins (*), so that should not be the problem. We tested loading the SVG using an <object> element, and it works, but we do not want to use that approach or fetch and embed it as an inline SVG for certain reasons. What can we do to resolve this?
8 Replies
Benjamin Fazli
Benjamin FazliOP•5d ago
No description
Benjamin Fazli
Benjamin FazliOP•5d ago
No description
Benjamin Fazli
Benjamin FazliOP•5d ago
Erisa
Erisa•5d ago
do you have an example html page as well? when i load https://cdn.modulify.ai/files/67cab8d626c15b1846041397.svg directly it appears to render correctly in firefox but in chrome shows the code:
No description
Erisa
Erisa•5d ago
No description
Erisa
Erisa•4d ago
ah great ?crossposting
SuperHelpflare
SuperHelpflare•4d ago
Please do not post your question in multiple channels/post it multiple times per the rules at #😃welcome-and-rules. It creates confusion for people trying to help you and doesn't get your issue or question solved any faster.
Erisa
Erisa•4d ago
locking in that case, thanks leo

Did you find this page helpful?