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

wired-card calls non-existing this._requestRender() #31

Closed
balloob opened this issue Jun 21, 2018 · 4 comments
Closed

wired-card calls non-existing this._requestRender() #31

balloob opened this issue Jun 21, 2018 · 4 comments

Comments

@balloob
Copy link

balloob commented Jun 21, 2018

<wired-card> calls this._requestRender() when the slotchange event is fired. However, that method does not exist on the elemnt.

https://github.com/wiredjs/wired-elements/blob/da4f150c04a336df41e228b794f14663f54b6d6f/packages/wired-card/wired-card.js#L55

<wired-card> depends on Lit Element ^0.5.1. I've checked the source code of Lit Element, and it looks like they renamed it to this.requestRender():

https://github.com/Polymer/lit-element/blob/fb90e7640777cab01c9eac2006cde558c34b041d/src/lit-element.ts#L261

(I did a quick search and noticed a few more places that call _requestRender().

I was using <wired-card> by importing it form unpkg:

<script type='module' src='https://unpkg.com/wired-card@0.6.0/wired-card.js?module'></script>
@pshihn
Copy link
Contributor

pshihn commented Jun 21, 2018

Sure enough, lit-element changed their API in 0.5.2 and that version is getting picked up. They should have used 0.6 for breaking changes fo semVer to work.
In the short term, if you can explicitly depend on lit-element 0.5.1, you may avoid running into this issue.

@pshihn pshihn changed the title paper-card calls non-existing this._requestRender() wired-card calls non-existing this._requestRender() Jun 21, 2018
@pshihn
Copy link
Contributor

pshihn commented Jun 21, 2018

Resolved by upgrading to latest lit-element and adjusting code accordingly:
#32

Fix in v0.6.5

@pshihn pshihn closed this as completed Jun 21, 2018
@balloob
Copy link
Author

balloob commented Jun 22, 2018

Thanks 🙂

Now featuring Wired JS in the custom cards example for Home Assistant https://developers.home-assistant.io/docs/en/lovelace_custom_card.html#defining-your-card

@pshihn
Copy link
Contributor

pshihn commented Jun 22, 2018

@balloob looks cool

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