thomasloven / lovelace-slider-entity-row

🔹 Add sliders to entity cards
MIT License
804 stars 131 forks source link

i.setConfig is not a function #293

Closed byte4geek closed 5 months ago

byte4geek commented 6 months ago

My Home Assistant version: 2024.1.3

My lovelace configuration method (GUI or yaml): GUI

What I am doing: Sometime i see this error on my lovelace card, this appear from 2024.1 this error in not present on the version 2023.12 this error is present in the companion app too.

slider-entity-raw_error

When i refresh the page the error go away but randomly reappear

slider-entity-raw_ok

The lovelace card is the same since 3 year.

What happened instead:

Minimal steps to reproduce: none

# The least ammount of code possible to reproduce my error
entities:
  - type: section
    label: Sala
  - entity: light.piantana
    name: Piantana
    toggle: true
    type: custom:slider-entity-row
  - entity: light.lampada_giappo
    name: Lamp Jap
    toggle: true
    type: custom:slider-entity-row
  - entity: light.divano
    name: Divano
    toggle: true
    type: custom:slider-entity-row
  - entity: light.hyperion
    toggle: true
    type: custom:slider-entity-row
  - entity: switch.sonoff_sala
    name: Luce Sala
  - entity: switch.sonoff_salesala
    name: Lampada di Sale
  - type: section
    label: Cucina
  - entity: switch.sonoff_cucina
    name: Luce Cucina
  - entity: switch.sonoff_lavabo_cucina
    name: Luce Lavandino
  - type: section
    label: Corridoio
  - entity: switch.sonoff_corridoio
    name: Luce Corridoio
  - type: section
    label: Camere da Letto
  - entity: switch.sonoff_camera_letto
    name: Luce Camera da Letto
  - entity: switch.sonoff_camera_chris
    name: Luce Camera Chris
  - entity: switch.sonoff_sale_christian
  - entity: switch.sonoff_camera_vale
    name: Luce Camera Vale
  - type: section
    label: Bagni
  - entity: switch.sonoff_bagno_grande
    name: Luce Bagno Donne
  - entity: switch.sonoff_bagno_piccolo
    name: Luce Bagno Uomini
show_header_toggle: true
state_color: true
title: Luci
type: entities

# End of code

Error messages from the browser console:

Map.js:1 

       Failed to load resource: the server responded with a status of 404 (Not Found)
Class.js:1 

       Failed to load resource: the server responded with a status of 404 (Not Found)
scoped-custom-element-registry.js:1 

       Failed to load resource: the server responded with a status of 404 (Not Found)
308slider-entity-row.js?hacstag=1448997001741:1 Uncaught (in promise) TypeError: L is not a function
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:33123)
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:19775)
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:19071)
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:18790)
    at h (slider-entity-row.js?hacstag=1448997001741:1:2833)
    at Generator.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:4179)
    at Generator.throw (slider-entity-row.js?hacstag=1448997001741:1:3262)
    at A (slider-entity-row.js?hacstag=1448997001741:1:8748)
    at a (slider-entity-row.js?hacstag=1448997001741:1:8987)
4slider-entity-row.js?hacstag=1448997001741:1 Uncaught TypeError: L is not a function
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:33693)
    at t.disconnectedCallback (scoped-custom-element-registry.js:262:45)
    at partial-panel-resolver.ts:169:14
4logging-mixin.ts:57 Failure writing uncaught error to system log: 3
(anonymous) @ logging-mixin.ts:57
4slider-entity-row.js?hacstag=1448997001741:1 Uncaught (in promise) TypeError: L is not a function
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:56615)
    at h (slider-entity-row.js?hacstag=1448997001741:1:2833)
    at Generator.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:4179)
    at Generator.next (slider-entity-row.js?hacstag=1448997001741:1:3262)
    at A (slider-entity-row.js?hacstag=1448997001741:1:8748)
    at s (slider-entity-row.js?hacstag=1448997001741:1:8951)
    at slider-entity-row.js?hacstag=1448997001741:1:9010
    at new Promise (<anonymous>)
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:8891)
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:56759)
56slider-entity-row.js?hacstag=1448997001741:1 Uncaught (in promise) TypeError: L is not a function
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:33123)
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:19775)
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:19071)
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:18790)
    at h (slider-entity-row.js?hacstag=1448997001741:1:2833)
    at Generator.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:4179)
    at Generator.throw (slider-entity-row.js?hacstag=1448997001741:1:3262)
    at A (slider-entity-row.js?hacstag=1448997001741:1:8748)
    at a (slider-entity-row.js?hacstag=1448997001741:1:8987)
4slider-entity-row.js?hacstag=1448997001741:1 Uncaught TypeError: L is not a function
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:33693)
    at t.disconnectedCallback (scoped-custom-element-registry.js:262:45)
    at o.value (hui-root.ts:937:12)
    at hui-root.ts:681:34
slider-entity-row.js?hacstag=1448997001741:1 Uncaught TypeError: L is not a function
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:9353)
    at new s (slider-entity-row.js?hacstag=1448997001741:1:54665)
    at E (scoped-custom-element-registry.js:388:7)
    at new t (scoped-custom-element-registry.js:236:11)
    at r (create-element-base.ts:91:28)
    at create-element-base.ts:109:12
    at h (create-element-base.ts:213:12)
    at c (create-element-base.ts:170:12)
    at _ (create-row-element.ts:106:3)
    at a.value (hui-entities-card.ts:298:21)
create-element-base.ts:180 row custom:slider-entity-row TypeError: i.setConfig is not a function
    at r (create-element-base.ts:95:11)
    at create-element-base.ts:109:12
    at h (create-element-base.ts:213:12)
    at c (create-element-base.ts:170:12)
    at _ (create-row-element.ts:106:3)
    at a.value (hui-entities-card.ts:298:21)
    at hui-entities-card.ts:223:18
    at Array.map (<anonymous>)
    at a.value (hui-entities-card.ts:222:35)
    at a.update (lit-element.ts:160:24)
c @ create-element-base.ts:180
slider-entity-row.js?hacstag=1448997001741:1 Uncaught TypeError: L is not a function
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:9353)
    at new s (slider-entity-row.js?hacstag=1448997001741:1:54665)
    at E (scoped-custom-element-registry.js:388:7)
    at new t (scoped-custom-element-registry.js:236:11)
    at r (create-element-base.ts:91:28)
    at create-element-base.ts:109:12
    at h (create-element-base.ts:213:12)
    at c (create-element-base.ts:170:12)
    at _ (create-row-element.ts:106:3)
    at a.value (hui-entities-card.ts:298:21)
create-element-base.ts:180 row custom:slider-entity-row TypeError: i.setConfig is not a function
    at r (create-element-base.ts:95:11)
    at create-element-base.ts:109:12
    at h (create-element-base.ts:213:12)
    at c (create-element-base.ts:170:12)
    at _ (create-row-element.ts:106:3)
    at a.value (hui-entities-card.ts:298:21)
    at hui-entities-card.ts:223:18
    at Array.map (<anonymous>)
    at a.value (hui-entities-card.ts:222:35)
    at a.update (lit-element.ts:160:24)
c @ create-element-base.ts:180
slider-entity-row.js?hacstag=1448997001741:1 Uncaught TypeError: L is not a function
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:9353)
    at new s (slider-entity-row.js?hacstag=1448997001741:1:54665)
    at E (scoped-custom-element-registry.js:388:7)
    at new t (scoped-custom-element-registry.js:236:11)
    at r (create-element-base.ts:91:28)
    at create-element-base.ts:109:12
    at h (create-element-base.ts:213:12)
    at c (create-element-base.ts:170:12)
    at _ (create-row-element.ts:106:3)
    at a.value (hui-entities-card.ts:298:21)
create-element-base.ts:180 row custom:slider-entity-row TypeError: i.setConfig is not a function
    at r (create-element-base.ts:95:11)
    at create-element-base.ts:109:12
    at h (create-element-base.ts:213:12)
    at c (create-element-base.ts:170:12)
    at _ (create-row-element.ts:106:3)
    at a.value (hui-entities-card.ts:298:21)
    at hui-entities-card.ts:223:18
    at Array.map (<anonymous>)
    at a.value (hui-entities-card.ts:222:35)
    at a.update (lit-element.ts:160:24)
c @ create-element-base.ts:180
slider-entity-row.js?hacstag=1448997001741:1 Uncaught TypeError: L is not a function
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:9353)
    at new s (slider-entity-row.js?hacstag=1448997001741:1:54665)
    at E (scoped-custom-element-registry.js:388:7)
    at new t (scoped-custom-element-registry.js:236:11)
    at r (create-element-base.ts:91:28)
    at create-element-base.ts:109:12
    at h (create-element-base.ts:213:12)
    at c (create-element-base.ts:170:12)
    at _ (create-row-element.ts:106:3)
    at a.value (hui-entities-card.ts:298:21)
create-element-base.ts:180 row custom:slider-entity-row TypeError: i.setConfig is not a function
    at r (create-element-base.ts:95:11)
    at create-element-base.ts:109:12
    at h (create-element-base.ts:213:12)
    at c (create-element-base.ts:170:12)
    at _ (create-row-element.ts:106:3)
    at a.value (hui-entities-card.ts:298:21)
    at hui-entities-card.ts:223:18
    at Array.map (<anonymous>)
    at a.value (hui-entities-card.ts:222:35)
    at a.update (lit-element.ts:160:24)
c @ create-element-base.ts:180
24slider-entity-row.js?hacstag=1448997001741:1 Uncaught (in promise) TypeError: L is not a function
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:33123)
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:19775)
    at s.value (slider-entity-row.js?hacstag=1448997001741:1:19071)
    at s.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:18790)
    at h (slider-entity-row.js?hacstag=1448997001741:1:2833)
    at Generator.<anonymous> (slider-entity-row.js?hacstag=1448997001741:1:4179)
    at Generator.throw (slider-entity-row.js?hacstag=1448997001741:1:3262)
    at A (slider-entity-row.js?hacstag=1448997001741:1:8748)
    at a (slider-entity-row.js?hacstag=1448997001741:1:8987)

here the error on the homeassistant.log

2024-01-15 12:14:01.926 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'value_json' is undefined when rendering '{{ value_json.status == 'enabled' }}'
2024-01-15 12:14:11.117 ERROR (MainThread) [frontend.js.latest.202401040] Uncaught error from Chrome 120.0.0.0 on Windows 10
TypeError: L is not a function
s.value (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:33693)
apply (src/scoped-custom-element-registry.js:262:44)
_selectView (src/panels/lovelace/hui-root.ts:937:11)
this._navigateToView (src/panels/lovelace/hui-root.ts:681:33)
2024-01-15 12:14:11.117 ERROR (MainThread) [frontend.js.latest.202401040] Uncaught error from Chrome 120.0.0.0 on Windows 10
TypeError: L is not a function
s.value (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:33693)
apply (src/scoped-custom-element-registry.js:262:44)
_selectView (src/panels/lovelace/hui-root.ts:937:11)
this._navigateToView (src/panels/lovelace/hui-root.ts:681:33)
2024-01-15 12:14:11.121 ERROR (MainThread) [frontend.js.latest.202401040] Uncaught error from Chrome 120.0.0.0 on Windows 10
TypeError: L is not a function
s.value (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:33693)
apply (src/scoped-custom-element-registry.js:262:44)
_selectView (src/panels/lovelace/hui-root.ts:937:11)
this._navigateToView (src/panels/lovelace/hui-root.ts:681:33)
2024-01-15 12:14:11.121 ERROR (MainThread) [frontend.js.latest.202401040] Uncaught error from Chrome 120.0.0.0 on Windows 10
TypeError: L is not a function
s.value (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:33693)
apply (src/scoped-custom-element-registry.js:262:44)
_selectView (src/panels/lovelace/hui-root.ts:937:11)
this._navigateToView (src/panels/lovelace/hui-root.ts:681:33)
2024-01-15 12:14:11.321 ERROR (MainThread) [frontend.js.latest.202401040] Uncaught error from Chrome 120.0.0.0 on Windows 10
TypeError: L is not a function
s.<anonymous> (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:9353)
new s (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:54665)
E (src/scoped-custom-element-registry.js:388:6)
J (src/scoped-custom-element-registry.js:236:10)
createErrorCardConfig (src/panels/lovelace/create-element/create-element-base.ts:91:27)
customElements.get (src/panels/lovelace/create-element/create-element-base.ts:109:11)
_getCustomTag (src/panels/lovelace/create-element/create-element-base.ts:213:25)
_getCustomTag (src/panels/lovelace/create-element/create-element-base.ts:170:11)
createRowElement (src/panels/lovelace/create-element/create-row-element.ts:107:4)
a.value (src/panels/lovelace/cards/hui-entities-card.ts:299:9)
2024-01-15 12:14:11.321 ERROR (MainThread) [frontend.js.latest.202401040] Uncaught error from Chrome 120.0.0.0 on Windows 10
TypeError: L is not a function
s.<anonymous> (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:9353)
new s (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:54665)
E (src/scoped-custom-element-registry.js:388:6)
J (src/scoped-custom-element-registry.js:236:10)
createErrorCardConfig (src/panels/lovelace/create-element/create-element-base.ts:91:27)
customElements.get (src/panels/lovelace/create-element/create-element-base.ts:109:11)
_getCustomTag (src/panels/lovelace/create-element/create-element-base.ts:213:25)
_getCustomTag (src/panels/lovelace/create-element/create-element-base.ts:170:11)
createRowElement (src/panels/lovelace/create-element/create-row-element.ts:107:4)
a.value (src/panels/lovelace/cards/hui-entities-card.ts:299:9)
2024-01-15 12:14:11.321 ERROR (MainThread) [frontend.js.latest.202401040] Uncaught error from Chrome 120.0.0.0 on Windows 10
TypeError: L is not a function
s.<anonymous> (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:9353)
new s (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:54665)
E (src/scoped-custom-element-registry.js:388:6)
J (src/scoped-custom-element-registry.js:236:10)
createErrorCardConfig (src/panels/lovelace/create-element/create-element-base.ts:91:27)
customElements.get (src/panels/lovelace/create-element/create-element-base.ts:109:11)
_getCustomTag (src/panels/lovelace/create-element/create-element-base.ts:213:25)
_getCustomTag (src/panels/lovelace/create-element/create-element-base.ts:170:11)
createRowElement (src/panels/lovelace/create-element/create-row-element.ts:107:4)
a.value (src/panels/lovelace/cards/hui-entities-card.ts:299:9)
2024-01-15 12:14:11.321 ERROR (MainThread) [frontend.js.latest.202401040] Uncaught error from Chrome 120.0.0.0 on Windows 10
TypeError: L is not a function
s.<anonymous> (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:9353)
new s (/hacsfiles/lovelace-slider-entity-row/slider-entity-row.js:1:54665)
E (src/scoped-custom-element-registry.js:388:6)
J (src/scoped-custom-element-registry.js:236:10)
createErrorCardConfig (src/panels/lovelace/create-element/create-element-base.ts:91:27)
customElements.get (src/panels/lovelace/create-element/create-element-base.ts:109:11)
_getCustomTag (src/panels/lovelace/create-element/create-element-base.ts:213:25)
_getCustomTag (src/panels/lovelace/create-element/create-element-base.ts:170:11)
createRowElement (src/panels/lovelace/create-element/create-row-element.ts:107:4)
a.value (src/panels/lovelace/cards/hui-entities-card.ts:299:9)

By putting an X in the boxes ([X]) below, I indicate that I:

ildar170975 commented 6 months ago

Is it a really MINIMAL code? Can it be reproduced w/o lines unrelated to the card?

byte4geek commented 6 months ago

Is it a really MINIMAL code? Can it be reproduced w/o lines unrelated to the card?

the code is what i put in the card.

i don't understand the second step, how i can reproduce it w/o card?

ildar170975 commented 6 months ago

This is one of the simplest principles of programming: try to reproduce on the minimal code. In this case "minimal" means - without rows which are not slider-entity-row.

byte4geek commented 6 months ago

i tryed it with this code in a simple card and the issue is present too.

entities:
  - entity: light.piantana
    name: Piantana
    toggle: true
    type: custom:slider-entity-row
  - entity: light.lampada_giappo
    name: Lamp Jap
    toggle: true
    type: custom:slider-entity-row
  - entity: light.divano
    name: Divano
    toggle: true
    type: custom:slider-entity-row
  - entity: light.hyperion
    toggle: true
    type: custom:slider-entity-row
show_header_toggle: true
state_color: true
title: Luci
type: entities
byte4geek commented 6 months ago

Please tell me what else I can remove from the code to make it even simple

ildar170975 commented 6 months ago

Very good. Now you have a minimized example. Tested it in Chrome+Win10 (& FF) - no issues.

  1. Have you tried to clean a browser's cache? Did it help? (same about resetting a frontend cache in a Companion App)
  2. Seems that the card was installed by HACS, is that right? Have you tried to remove the card - then clean a cache - then install again?
byte4geek commented 5 months ago

I tried again to remove the integration from HACS and put it back on now it seems to work correctly, it hasn't given me the problem for 5 days now, I'll check again and send an update.