Bubble-Card
Bubble-Card copied to clipboard
Unhandled promise rejection --> Cannot read properties of null (reading 'classList')
Describe the bug
When accessing the Dashboard containing Bubble-Card views/cards, the event bus is flooded with this and similar messages:
`event_type: call_service data: domain: system_log service: write service_data: logger: frontend.js.modern.202409060 message: >- Unhandled promise rejection from Chrome WebView 128.0.6613.127 on Android 14
TypeError: Cannot read properties of null (reading 'classList')
M (/hacsfiles/Bubble-Card/bubble-card.js:1:61291)
J.updateBubbleCard (/hacsfiles/Bubble-Card/bubble-card.js:1:82622)
set hass (/hacsfiles/Bubble-Card/bubble-card.js:1:82541)
changedProps.has (src/panels/lovelace/cards/hui-card.ts:164:33)
update (src/reactive-element.ts:1329:13)
performUpdate (src/reactive-element.ts:1261:16)
scheduleUpdate (src/reactive-element.ts:1233:24)
level: debug
origin: LOCAL time_fired: "2024-09-14T03:41:03.514171+00:00" context: id: 01J7Q9XCMTK8B2KAFNGPDW2WQ8 parent_id: null user_id: 7dadcc12bad942b1b22abffa30dccbfd `
This occurs in Safari for Mac, Chrome for Mac, iOS Companion, and Android Companion.
To Reproduce
Steps to reproduce the behavior:
- Install Bubble-Card
- load a Dashboard View with Bubble-Card
Expected behavior
I would expect that the null object is ignored. (?) But I am not sure. What is "normal"? The only reason why I found this, is because I was working on a total Dashboard overhaul and redesign. I found it to become a bit sluggish to load and perform some custom:state-switch card transitions. One of my cards, when used as a custom:button-card template inside a Bubble-Card Popup, wouldn't update the CSS colours (ie: coloured RGB light, selected colour is used for the Text colour, and img_cell background behind the icon). When the entire yaml is in the card, without using a template, the card and colours all work just fine.
It was during the troubleshooting for this, that I was listening to call_service on the events bus and saw this overwhelming recurrence of these Unhandled Promise Rejection messages. I tested further and determined they occur in any browser, and any platform.
Having had recently upgraded HACS to 2.1 from 1.x (and there was a breaking change mentioning the url /hacsfiles/ not being used in 2.0), I uninstalled Bubble Card and fully shut down and restarted my HA. The Unhandled Promises also vanished. (But obviously the Bubble-Cards didn't work.)
I re-installed Bubble-Card in the new HACS and the same issue persists.
Screenshots
YAML
If applicable, add any relevant YAML code.
Your code here
Informations (please complete the following information):
- iOS Companion version 2024.8.1 (iPhone 14 Pro Max iOS 17.6.1)
- Android Companion 2024.7.3-full (Samsung Galaxy S23 Ultra, Android 14 & OneUI 6.1)
- iMac Safari 17.6 and Chrome 128.0.6613.114
- Bubble Card version: 2.2.4
- Home Assistant:
- Core 2024.9.1
- Supervisor 2024.09.1
- Operating System 13.1
- Frontend 20240906.0
Additional context
As I was reviewing this issue again, after typing out this report, I realized that the error is slightly different for each browser type:
Android:
message: >- Unhandled promise rejection from Chrome WebView 128.0.6613.127 on Android 14 TypeError: Cannot read properties of null (reading 'classList') M (/hacsfiles/Bubble-Card/bubble-card.js:1:61291) J.updateBubbleCard (/hacsfiles/Bubble-Card/bubble-card.js:1:82622) set hass (/hacsfiles/Bubble-Card/bubble-card.js:1:82541) changedProps.has (src/panels/lovelace/cards/hui-card.ts:164:33) update (src/reactive-element.ts:1329:13) performUpdate (src/reactive-element.ts:1261:16) scheduleUpdate (src/reactive-element.ts:1233:24)
Mac Safari:
message: |- Unhandled promise rejection from Safari 17.6 on Mac OS 10.15.7 TypeError: null is not an object (evaluating 'e.popUp.classList') /hacsfiles/Bubble-Card/bubble-card.js:1:61290 M (/hacsfiles/Bubble-Card/bubble-card.js:1:63096) updateBubbleCard (/hacsfiles/Bubble-Card/bubble-card.js:1:82623) hass (/hacsfiles/Bubble-Card/bubble-card.js:1:82557) changedProps.has (src/panels/lovelace/cards/hui-card.ts:164:26) s (src/reactive-element.ts:1329:20) scheduleUpdate (src/reactive-element.ts:1233:24)
iOS:
message: |- Unhandled promise rejection from WebKit 605.1.15 on iOS 17.6.1 TypeError: null is not an object (evaluating 'e.popUp.classList') /hacsfiles/Bubble-Card/bubble-card.js:1:61290 M (/hacsfiles/Bubble-Card/bubble-card.js:1:63096) updateBubbleCard (/hacsfiles/Bubble-Card/bubble-card.js:1:82623) hass (/hacsfiles/Bubble-Card/bubble-card.js:1:82557) changedProps.has (src/panels/lovelace/cards/hui-card.ts:164:26) s (src/reactive-element.ts:1329:20) scheduleUpdate (src/reactive-element.ts:1233:24)
Thank you! 🍻