问题
Can someone please explain why the following error occurs and what it means?
Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Nodes of type 'HTML' may not be inserted inside nodes of type '#document'.
I am not sure I am able to reproduce it but it occurs from time to time, usually when I import more than one custom element. It's extremely hard giving exact context since I am working on integrating polymer's paper/core elements for our in-house widgets. Broadly speaking what are the cases that I would see this error? Any kind of help is appreciated. Thank you.
Regards, Raja
回答1:
I just had this same issue. I was importing core-icon.html
I discovered that the core-meta.html also includes the polymer.html, which I had already imported. I commented out the line in the core-meta.html that imported the polymer.html and my errors went away.
来源:https://stackoverflow.com/questions/26766181/hierarchyrequesterror-failed-to-execute-appendchild-on-node