Issues importing existing SVG
Hi, I'm facing the same issue as below:
when doing:
let svgstr = "<svg ... ";
const draw = SVG();
draw.svg(svgstr);
I get Uncaught (in promise) TypeError: Cannot read property 'nodeName' of null
I am hitting a bug with the existing release in importing SVG. When I call:
const otherSvg = SVG().svg(svgString);I get a null reference exception in the parent function:
parent (type) { if (this.isRoot()) { return this.node.parentNode.nodeName === '#document' ? null : adopt(this.node.parentNode) }This function is called from the
svgfunction which imports the svg data from a string.I tested building my own and it appears this issue has already been fixed (and the relevant functions are fairly different.). Can anyone suggest a workaround to this in the meantime? Am I creating the SVG object incorrectly?
_Originally posted by @BrianHanechak in
https://github.com/svgdotjs/svg.js/issues/1152#issuecomment-715032602_
same
cant reproduce