Skip to content
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

parentNode is null JS Error #32

Open
sean-roberts opened this issue Sep 2, 2015 · 0 comments
Open

parentNode is null JS Error #32

sean-roberts opened this issue Sep 2, 2015 · 0 comments

Comments

@sean-roberts
Copy link

Hey guys, I am using the iconic.js library and I can isolate that it's the SVGInjector line that is causing me troubles:

el.parentNode.replaceChild(svg, el);

The context of my issue is, I have an angular application that uses iconic to handle loading in the svgs. We are running into issues because of some weird intermediate states that the parentNode is null for certain elements, like when we are binding to the element before it gets into the dom like on a directive template replacement.

That said, I am wondering if making the check for whether or not the image is available to be replaced (via parentNode.replaceChild) is a condition worthy of being added as a prerequisite for processing similar to the perquisites of it being a .svg file type?

tanem pushed a commit to tanem/react-svg that referenced this issue Dec 18, 2016
Credit to @apires for the idea in #13. See issues #12 and iconic/SVGInjector#32.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant