Skip to content
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

Can't dynamically import an element definition in Canary #477

Closed
JanMiksovsky opened this issue Apr 23, 2014 · 3 comments
Closed

Can't dynamically import an element definition in Canary #477

JanMiksovsky opened this issue Apr 23, 2014 · 3 comments

Comments

@JanMiksovsky
Copy link

I want to dynamically import an element definition and then use the imported definition to create or upgrade elements. Generally speaking, dynamic HTML imports do work (per threads like http://stackoverflow.com/questions/21607663/dynamically-load-web-components-html-imports and https://groups.google.com/forum/#!searchin/polymer-dev/dynamic/polymer-dev/uarVrxBK7XU/kzzXo2pFPTYJ). However, I can't seem to get this working when importing a <polymer-element> definition.

See http://jsbin.com/lopaf/6/edit, which wants to load the element contents at http://jsbin.com/vovun/2/edit.

As noted, it doesn't appear possible to actually demonstrate HTML imports in a jsbin because of CORS restrictions in the iframe arrangement jsbin uses, but even if these files are saved locally, the result doesn't work in Canary 36.0.1952.0.

The static import version does work, so it appears to be an issue with adding the HTML Import dynamically. The dynamic import does take place — the imported files and any dependencies appear in the debugger's Network tab, among other things — but the definition never gets applied to the page.

If I use production Chrome 34.0.1847.116, the dynamic import works. This suggests that it could be a problem with native HTML Imports, but given that the content appears to be successfully imported, I was wondering if this was a Polymer bug. If this appears to be a Chrome bug, please let me know and I'll file it there.

@sjmiles
Copy link
Contributor

sjmiles commented Apr 23, 2014

https://code.google.com/p/chromium/issues/detail?id=365956

On Tue, Apr 22, 2014 at 8:59 PM, Jan Miksovsky notifications@github.comwrote:

I want to dynamically import an element definition and then use the
imported definition to create or upgrade elements. Generally speaking,
dynamic HTML imports do work (per threads like
http://stackoverflow.com/questions/21607663/dynamically-load-web-components-html-importsand
https://groups.google.com/forum/#!searchin/polymer-dev/dynamic/polymer-dev/uarVrxBK7XU/kzzXo2pFPTYJ).
However, I can't seem to get this working when importing a
definition.

See http://jsbin.com/lopaf/6/edit, which wants to load the element
contents at http://jsbin.com/vovun/2/edit.

As noted, it doesn't appear possible to actually demonstrate HTML imports
in a jsbin because of CORS restrictions in the iframe arrangement jsbin
uses, but even if these files are saved locally, the result doesn't work in
Canary 36.0.1952.0.

The static import version does work, so it appears to be an issue with
adding the HTML Import dynamically. The dynamic import does take place
— the imported files and any dependencies appear in the debugger's Network
tab, among other things — but the definition never gets applied to the page.

If I use production Chrome 34.0.1847.116, the dynamic import works. This
suggests that it could be a problem with native HTML Imports, but given
that the content appears to be successfully imported, I was wondering if
this was a Polymer bug. If this appears to be a Chrome bug, please let me
know and I'll file it there.


Reply to this email directly or view it on GitHubhttps://github.com//issues/477
.

@JanMiksovsky
Copy link
Author

@sjmiles Thank you so much for the fast reply! This bug sank 6 hours of my day, but at least I now I have confirmation it's real and being worked on.

@sjmiles
Copy link
Contributor

sjmiles commented Apr 23, 2014

Sorry about that, this caught us by surprise too.

On Tue, Apr 22, 2014 at 10:02 PM, Jan Miksovsky notifications@github.comwrote:

Closed #477 #477.


Reply to this email directly or view it on GitHubhttps://github.com//issues/477
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants