Need help with "Failed to execute 'insertBefore' on 'Node'" errors. #2909
EverettMcKay
started this conversation in
General
Replies: 2 comments
-
I think I just got lucky. The problem seems to be with one of the svg icons. This works:
But this doesn't:
Suspecting the polygon tag. If so, would be great to issue a run-time warning instead of an insertBefore error. |
Beta Was this translation helpful? Give feedback.
0 replies
-
As in the other issue, we could help you better if you provided us a repro. The error message makes me thing that something other that Mithril modifies with the DOM, resulting in problems when updating. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
I'm getting a "Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node." error, and as a result my app isn't rendering correctly. Of course, my app doesn't have any insertBefore calls, so I assume this is coming from the Mithril difference engine.
A few questions:
Since I don't know that the exact problem, I can't narrow it down enough to give code samples. Generally, what I am doing is presenting a list of svg icons (think star ratings) and updating their color and icon type (empty, filled in) based on the current state. Oddly, if I hardwire their color and type, the problem goes away. So the problem only happens when I update their presentation dynamically based on clicking.
Forcing a refresh results in the component drawing correctly. I had hoped that calling m.redraw() might fix the problems by redrawing the icons, but no luck there.
Finally, in the past I have been able to get problems like this to go away with either calling redraw or changing the keys. Neither solution appears to work in this case.
Beta Was this translation helpful? Give feedback.
All reactions