-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Trying to import core-ajax I get an appendChild on #document error #810
Comments
The idea is that you never include polymer.js directly...anwywhere. You always use an HTML import to bring in polymer.html:
The reason being that all elements that reference
Shadow DOM is a feature for DOM and css scoping. It doesn't have anything to say about JS. |
I admit ridiculous is a strong word; I still don't agree JS shouldn't be scoped in shadow DOM, but I see how it's debatable. As for including polymer.js, are you suggesting one should always include polymer.html instead of polymer.js? because the documentation and samples for creating your own elements suggest including polymer.js. Perhaps those docs should be updated? |
Where are you seeing We do include If we're suggesting |
hmmm I don't know where i got the idea to include polymer.js... that's weird. Perhaps something initially didn't work, but then worked once i included polymer and then i never fixed the issue properly or some such. In the docs, very early it mentions including platform.js, then doesn't bother repeating its self (which is fine). So if you're allowed to both include platform.js and core-ajax.html, then it's fine and I'm just crazy. Also sorry for the accusation... I wonder where the heck I got the idea that it suggested to use polymer.js... there is usually a reason why i do things... im very confused. |
Uncaught HierarchyRequestError: Failed to execute 'appendChild' on 'Node': Nodes of type 'HTML' may not be inserted inside nodes of type '#document'. polymer.concat.js:6313
The error is actually readable, but doesn't make sense to me in the context... is Polymer trying to attach the core-ajax template to the html node?
I'm including the core-ajax after including platform.js and my own created elements work fine.
I'm including core-ajax as thus:
EDIT: Ok that took forever to find and google barely helped.
First of all, it's dumb that your system is so fragile that it breaks if included twice. Second, it's also ridiculous that shadow-dom doesn't keep it's scope for JS to itsself. Essentially including polymer.js in my code cause platform code to be included, which was apparently already included through core-ajax, which caused the appendChild error.
So if I want to use polymer without core-elements, then i need to include polymer.js. As soon as i add core-elements I have to remove that polymer.js include.
The text was updated successfully, but these errors were encountered: