-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Version 3.1.2 breaks our code with TypeError: Cannot read property 'Node' of undefined #1252
Comments
The failing test is caused by a change in export function nodeOrNew (name, node) {
return (node && node.ownerDocument && node instanceof node.ownerDocument.defaultView.Node) ? node : create(name)
} before it was checking for It seems like your framework that you are using for testing does not support |
Because we are generating the SVG either on the server or on the client we are using svgdom library. Do you see a simple way to let it work again with svgdom ? |
I am using svgdom for testing as well and it's all green 🤔 |
Oh, you are running a rather old version of svgdom. Updating should solve this problem |
I'm also having an issue with this nodeOrNew function, in Firefox 97.0: I'm parsing some XML into an SVG in a pretty simple way:
And then I get this error stemming from .find('path'):
As far as I'm aware, it was working within the last 1 or 2 days and now it's not... Going back to 3.1.1 is my solution for now |
I also ran into this when upgrading 3.0.16 to 3.1.2, but only after I updated TypeScript 4.3.5 to 4.6.4. Previously I needed to get svg files via XHR/fetch and then I'd parse into an To resolve it, I needed to call
Then essentially
Hope this helps. |
I relaxed the code so that it allows unimported nodes as well. You are better off just using the const rect = SVG('<rect width="100" height="100" />') This will take care of that problem for you |
I am sorry, I somehow forgot to publish all the fixes I made. I just released it: |
Bug report
Explanation
Since the last release of (3.1.2) the test cases in our open-source project are not passing anymore:
https://github.com/cheminfo/mass-tools/runs/4983444371?check_suite_focus=true#step:6:462
The code that generates this error is quite complex and if this error is not obvious I may try to reduce the code and create a fiddle.
In the meantime I forced versions 3.1.1 that works perfectly.
The text was updated successfully, but these errors were encountered: