Closed KermanX closed 1 year ago
Read the last sentence in the readme and it begins to make sense :D.
This Dom implementation is not 100% to spec. If you encountered an error, create a reproduction so I can fix the bug. Just positing an error message doesn't help that much :D
I'm sorry that I carelessly haven't seen the last sentence in the readme.
You can reproduce the error via the following steps:
src/index.ts
L56-L64
render
function.However, I personally think that it isn't a must to reproduce the error, because the error in the above case is simple:
svgdom/src/utils/bboxUtils.js Line46 uses window.NodeList.prototype.reduce
, but jsdom doesn't implement it.
Thanks for your help.
You are somehow mixing 2 dom libraries and expecting it to work. It most likely wont. The bug you encounter is because jsdom expects a dom created by jsdom
Thanks for your help. I mixed two libraries because I want to use svgdom as a polyfill for running mermaid in jsdom, nodejs. I opened this issue just wondering if it is a mistake. Since it now turned out to be not, I am closing the issue.
😀
https://github.com/svgdotjs/svgdom/blob/cde873e869ad57d772fda593fa2a8b125fac6871/src/utils/bboxUtils.js#L46
Here
window.NodeList.prototype.reduce
is used, but AFAIK, there is no definition of it in MDN.The issue is exposed especially when running SVGDOM with JSDOM.