[webcomponents] Unable to get Custom Elements working in a static page. (#392)

Hello,

I'm working on a library (at http://infamous.io, for now at least) in which I'm creating a set of Custom Elements for rendering a 3D scene.

I have a small problem. Everything works fine when I use the custom elements in the `<body>` of a Meteor app, but when I try doing the exact same thing with a static HTML page and the scripts manually included in the `<head>`, it fails and doesn't work as expected. I'm not sure if I'm doing something wrong and don't know something about Custom Elements, or if there's a problem with the API.

To see the working demo, just

```sh
git clone git@github.com:trusktr/site.git
cd site
git checkout infamous-motor-html # it's on this branch.
npm install
meteor # meteor is really easy to install, meteor.com
```

The result looks like this, the teal and pink elements positioned as expected in 3D space:

![working](https://cloud.githubusercontent.com/assets/16913311/13231453/d1dc4baa-d95e-11e5-8bf1-62a83c1f9488.jpg)

Now, if you look in the `public` folder, you'll see the static version in `html-demo.html` (you can open this directly in your browser with `file://`, or visit `localhost:3000/html-demo.html` while running the Meteor app. I have double checked, and I believe that I am doing the same exact thing as in the Meteor version, but I simply cannot get the expected result, and it looks like this:

![not-working](https://cloud.githubusercontent.com/assets/16913311/13231486/f0104626-d95e-11e5-8e64-844c377cda60.jpg)

I'm not sure what the problem is, and why it works in the Meteor version (Meteor 1.3 compiles the code with Babel) and doesn't work in the static version (also compiled with Babel via Webpack).

Any ideas?

---
Reply to this email directly or view it on GitHub:
https://github.com/w3c/webcomponents/issues/392

Received on Monday, 22 February 2016 20:26:12 UTC