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

Custom Element not working #28

Open
ghost opened this issue Apr 6, 2018 · 3 comments
Open

Custom Element not working #28

ghost opened this issue Apr 6, 2018 · 3 comments

Comments

@ghost
Copy link

ghost commented Apr 6, 2018

  1. ember new DisplayTile -b @glimmer/blueprint --web-component=display-table
  2. ember b --prodcution
  3. < DisplayTile> < /DisplayTile> --> nothing happens
  4. < display-title> < /display-title> --> DOMException: Failed to execute 'insertBefore' on 'Node': The node before which the new node is to be inserted is not a child of this node.
@ajgribble
Copy link

ajgribble commented Apr 17, 2018

I had the same issue with glimmer/[email protected] (but not 0.8.0). I haven't had a chance to chase down the underlying issue but changing the 'whenRendered' function in initialize-custom-elements.js with the following fixes the issue:

function whenRendered(app, callback) {
  // if (app['_rendering']) {
  if (!app['_rendered']) {
    requestAnimationFrame(() => {
      whenRendered(app, callback);
    });
  } else {
    callback();
  }
}

@rbrcurtis
Copy link

rbrcurtis commented Jul 3, 2018

I just put up a PR to fix this: #29 (the exception, not the docuementation)

@mrosenberg
Copy link

The rendering engine changed from sync to async. Edit your main.ts.

app.boot();
initializeCustomElements(app, {'foo-bar': 'FooBar'});

to

app.boot()
.then(() => {
  initializeCustomElements(app, {'foo-bar': 'FooBar'});
});

That should fix your web component.

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

3 participants