-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Need help with "Failed to execute 'insertBefore' on 'Node'" errors. #2885
Labels
Type: Question
For issues that are purely questions about Mithril, not necessarily bug reports or suggestions
Comments
EverettMcKay
added
the
Type: Question
For issues that are purely questions about Mithril, not necessarily bug reports or suggestions
label
Sep 29, 2023
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. |
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. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Type: Question
For issues that are purely questions about Mithril, not necessarily bug reports or suggestions
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.
The text was updated successfully, but these errors were encountered: