Help me understand this error

165 views
Skip to first unread message

rajana...@gmail.com

unread,
Nov 5, 2014, 2:04:30 PM11/5/14
to polym...@googlegroups.com
Hello All,

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

Eric Bidelman

unread,
Nov 5, 2014, 3:21:45 PM11/5/14
to rajana...@gmail.com, polymer-dev

Follow Polymer on Google+: plus.google.com/107187849809354688692
---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/polymer-dev/0864f284-cf4b-44ae-a5f5-dd63bcf54924%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

gree...@gmail.com

unread,
Nov 5, 2014, 11:57:52 PM11/5/14
to polym...@googlegroups.com, rajana...@gmail.com
Hi,

I've seen exactly this error when multiple instances of TemplateBinding.js were included in the page. The error happened at this line:


var html = d.appendChild(d.createElement('html'));

it's the attempt to insert second html element that failed.

Not sure if the same thing is happening in your case, but I got it when I had custom element with bower.json that referenced polymer-dev repo instead of polymer (back when -dev repos were still in use, and I wanted to pull in non-minified code for some debugging).

My component pulled in polymer-dev, other dependencies pulled in polymer, that's how I ended up with two copies of polymer scripts.

Hope this helps,
Artem

rajana...@gmail.com

unread,
Nov 6, 2014, 9:27:48 AM11/6/14
to polym...@googlegroups.com, rajana...@gmail.com
Hey,

It's the same error for the same line but in a different file, the full error with the file name is below 

Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Nodes of type 'HTML' may not be inserted inside nodes of type '#document'.  polymer.concat.js:6290


Raja

Rob Dodson

unread,
Dec 7, 2014, 7:04:16 PM12/7/14
to rajana...@gmail.com, polymer-dev
Just curious: are you using the yeoman generator to build your project?

Follow Polymer on Google+: plus.google.com/107187849809354688692

---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.

raja naresh

unread,
Dec 8, 2014, 1:13:57 PM12/8/14
to Rob Dodson, polymer-dev
Nope, if I remember correctly I just bower installed all the core and paper elements but I have two different versions of it and my project used (imported) elements from both versions (not duplicates but different elements). The error resolved when I changed all the import paths to the same version of the core and paper elements. 

I took a detour from this after quick fixing but I should probably do what @artem suggested here http://stackoverflow.com/questions/26766181/please-help-me-understand-this-error. Any other ideas are welcome as well, I will eventually get back to this. Thank you very much. 


Andrew Fallows

unread,
Dec 10, 2014, 4:39:21 PM12/10/14
to polym...@googlegroups.com, rajana...@gmail.com
I'm encountering this same issue after using vulcanize to build my component tree into a single file.


That error happens at the top, and then I get a lot of Uncaught TypeErrors (although I think these are a side effect of the first issue, because the first issue breaks the Polymer object).

Rob Dodson

unread,
Dec 12, 2014, 3:55:42 PM12/12/14
to Andrew Fallows, polymer-dev, Raja Naresh
Can you post your project to github so we can see how the source is arranged?

Follow Polymer on Google+: plus.google.com/107187849809354688692

---
You received this message because you are subscribed to the Google Groups "Polymer" group.
To unsubscribe from this group and stop receiving emails from it, send an email to polymer-dev...@googlegroups.com.

Andrew Fallows

unread,
Dec 15, 2014, 9:49:25 AM12/15/14
to Rob Dodson, polymer-dev, Raja Naresh
Unfortunately, I can't do that -- don't have permission to make my project public. I think I traced down the root of my issue, and it had to do with a tool in our build pipeline which was injecting opening and closing <html> and <body> tags into html partials (and all of our components were written as html partials).
Reply all
Reply to author
Forward
0 new messages