googlearchive / TemplateBinding

TemplateBinding Prolyfill
290 stars 61 forks source link

after `fix for resolving css urls` commit, TemplateBinding is throwing #158

Closed sjmiles closed 10 years ago

sjmiles commented 10 years ago

I'm getting

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

Throwing consistently in Canary and Chrome (stable) on my Windows machine when I attempt to use it as part of platform. I.e. 'platform` tests all fail.

TemplateBinding tests are all green.

Commit reference: https://github.com/Polymer/TemplateBinding/commit/08008af605298aaf2d56ef34d4af4df70679ea61#diff-bb73baf1485cd281bcda48f60572ba1cR170

sorvell commented 10 years ago

This is because we apply the same fix inside the platform repo. It looks like the code in TemplateBinding is throwing because it's expecting to get first access to the template ownerDocument.

I'll remove the code in Platform now that TemplateBinding addresses this directly.

sorvell commented 10 years ago

Fix via https://github.com/Polymer/platform-dev/commit/a258a14a7f4db32af35cc147ab86cc7259290e35

morrisonlevi commented 10 years ago

I'm getting the same error message on line 163, but I don't know how to tell what version I have because I downloaded it as a zip file (downloaded today).

Here are lines 160-168:

(function() {
  var t = document.createElement('template');
  var d = t.content.ownerDocument;
  var html = d.appendChild(d.createElement('html'));
  var head = html.appendChild(d.createElement('head'));
  var base = d.createElement('base');
  base.href = document.baseURI;
  head.appendChild(base);
})();
jaan commented 9 years ago

i get the same error, any solution?

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

  if (hasTemplateElement) {
    // TODO(rafaelw): Remove when fix for
    // https://codereview.chromium.org/164803002/
    // makes it to Chrome release.
    (function() {
      var t = document.createElement('template');
      var d = t.content.ownerDocument;
      var html = d.appendChild(d.createElement('html')); //error line
      var head = html.appendChild(d.createElement('head'));
      var base = d.createElement('base');
      base.href = document.baseURI;
      head.appendChild(base);
    })();
  }
jaan commented 9 years ago

This error got fixed once i removed the abs path in one of the component. Issue mentioned here https://github.com/Polymer/grunt-vulcanize/issues/17