jcwillox / lovelace-canary

🐤 Adds many useful extensions to lovelace, such as templating secondary info, stacking within a card and more!
MIT License
97 stars 4 forks source link

Canary doesn't work with HA 2021.6 #16

Closed bieniu closed 3 years ago

bieniu commented 3 years ago

Card configuration:

      - type: vertical-stack
        in_card: true
        cards:
          - type: glance
            title: "Salon"
            show_name: false
            entities:
              - sensor.temperature_salon
              - sensor.humidity_salon
              - sensor.co2_salon
              - sensor.illumination_salon
          - type: entities
            show_header_toggle: false
            state_color: true
            entities:
              - binary_sensor.window_salon
              - entity: binary_sensor.motion_salon

I think this problem is related to this https://developers.home-assistant.io/blog/2021/05/19/lit-2.0

Console error:

app.cdb4df30.js:13498 The main 'lit-element' module entrypoint is deprecated. Please update your imports to use the 'lit' package: 'lit' and 'lit/decorators.ts' or import from 'lit-element/lit-element.ts'.
55704 @ app.cdb4df30.js:13498
s @ app.cdb4df30.js:36059
53918 @ app.cdb4df30.js:7396
s @ app.cdb4df30.js:36059
(anonymous) @ app.cdb4df30.js:36059
(anonymous) @ app.cdb4df30.js:42171
(anonymous) @ app.cdb4df30.js:42171
canary.js:1  CANARY  0.3.3 
canary.js:1 Uncaught (in promise) TypeError: customElements.get(...).getStyles is not a function
    at canary.js:1
(anonymous) @ canary.js:1
Promise.then (async)
(anonymous) @ canary.js:1
n @ canary.js:1
(anonymous) @ canary.js:1
(anonymous) @ canary.js:1
McGiverGim commented 3 years ago

I can confirm is broken.

jcwillox commented 3 years ago

Glad I didn't update yet 😄. I agree it's most likely related to that change, I'll check it out tonight (like T-20h)

jcwillox commented 3 years ago

This should be fixed in release 0.3.4. Hopefully, that's all that this release broke 😁.

McGiverGim commented 3 years ago

@jcwillox it seems not work for me, I get this error:

Uncaught (in promise) TypeError: customElements.get(...).getStyles is not a function
    at canary.js:1

I've tried to restart HA and clear cache, but maybe I did something wrong.

@bieniu it works for you?

jcwillox commented 3 years ago

It must be on your end, I just checked the uploaded canary.js as it has no references to the .getStyles function anymore. Restarting HA probably won't do anything, try hitting ctrl+shift+r (force reload page) a couple of times, if that doesn't work, maybe try reinstalling canary?

McGiverGim commented 3 years ago

You are right @jcwillox without touching anything, it has started to work. Sorry for bother with this. I tried several times the refreshing without cache but it didn't work. Now it does.

Thanks!

jcwillox commented 3 years ago

That's all good browser cache has always been a bit odd, glad it's working now.

bieniu commented 3 years ago

I can confirm that the new version works without any problems. Thanks!