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

TypeError in Firefox when using a particular element two times #202

Closed
1 of 2 tasks
gitaarik opened this issue Sep 17, 2018 · 2 comments
Closed
1 of 2 tasks

TypeError in Firefox when using a particular element two times #202

gitaarik opened this issue Sep 17, 2018 · 2 comments

Comments

@gitaarik
Copy link

gitaarik commented Sep 17, 2018

Description

When you have an element like this:

class MyElement extends LitElement {

  render() {
    const cool = html`cool!`;
    return html`
      <div>${cool}</div>
    `;
  }

}

And you use this element two times, then you get a TypeError: this.endNode is null in your Firefox console. If you don't use the const but just put the string cool! at the place of ${cool} it doesn't happen. It works in Chrome.

Live Demo

Demo: https://understood-humor.glitch.me/
Source code: https://glitch.com/edit/#!/understood-humor

Steps to Reproduce

  1. Create an element like mentioned above
  2. Use this element two times on a page
  3. Test in Firefox

Expected Results

You should get two times the text "cool!" underneath each other.

Actual Results

In Firefox the text "cool!" only appears one time. The first element is rendered, after that you get an error in the console TypeError: this.endNode is null.

Browsers Affected

  • Chrome
  • Firefox

Versions

  • lit-element: v0.6.0
  • webcomponents: v2.1.2
@sorvell
Copy link
Member

sorvell commented Sep 17, 2018

The issue is actually with the latest release of lit-html. Tracked as lit/lit#505.

@gitaarik gitaarik changed the title TypeError: this.endNode is null in Firefox when using element with template part TypeError: this.endNode is null in Firefox when using element with template part Sep 17, 2018
@gitaarik gitaarik changed the title TypeError: this.endNode is null in Firefox when using element with template part TypeError: this.endNode is null in Firefox when using element with template part Sep 17, 2018
@gitaarik gitaarik changed the title TypeError: this.endNode is null in Firefox when using element with template part TypeError in Firefox when using a particular element two times Sep 17, 2018
@gitaarik
Copy link
Author

Nice! Thanks 😃 👍

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