Skip to content

parentNode is null JS Error #32

@sean-roberts

Description

@sean-roberts

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions