Skip to content
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.

Error when HTML Imports flag is disable #1

Closed
zenorocha opened this issue Mar 26, 2014 · 5 comments
Closed

Error when HTML Imports flag is disable #1

zenorocha opened this issue Mar 26, 2014 · 5 comments

Comments

@zenorocha
Copy link
Member

Uncaught TypeError: Cannot read property 'content' of null 

Any idea @robdodson? I thought platform.js should handle that.

@zenorocha zenorocha added the bug label Mar 26, 2014
@robdodson
Copy link
Contributor

You'll have to wait for the HTMLImportsLoaded event because platform uses XHR under the hood

http://www.polymer-project.org/platform/html-imports.html#polyfill-notes

@zenorocha
Copy link
Member Author

Tried to wrap everything into this listener: a2763ca

But then I got: "Cannot read property 'ownerDocument' of null"

@zenorocha
Copy link
Member Author

Read something about using _currentScript instead of currentScript. Still both are null.

http://www.polymer-project.org/platform/html-imports.html#other-notes

Any ideas?

@robdodson
Copy link
Contributor

#2 fixes the issue. Sorry for misinformation. You don't need the HTMLImportsLoaded listener when you're inside an import. But you do need to use _currentScript if the polyfill is in play. This change worked for me in Canary with and without the imports flag and in stable Chrome.

@zenorocha
Copy link
Member Author

Great! Thanks for the PR 👯

zenorocha pushed a commit to webcomponents/xtag-boilerplate that referenced this issue Apr 6, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants