Img.onerror called randomly - SVG string as source
0
I have a routine that takes a canvas context and an SVG string and renders it onto the canvas, that returns a promise that resolves once done. For whatever reason, it fails in Firefox & Safari(haven't tried in IE), but seems to be the only solution I can get to work all the time in Chrome. I've tried a couple different alternatives: convert it to a blob first, run that blob through createObjectURL, set img src to that, draw image on canvas. This works most of the time over HTTP, but over HTTPS it fails the majority of time, but not all the time. Convert it to a blob, use file reader to read it as a base64 SVG representation, set img src to the base64, draw image on canvas. code: export default (ctx, rawSVG, { width, height }) => new Promise((resolve, reject) => { const im