Mariusthvdb / custom-ui

Add templates and icon_color to Home Assistant UI
163 stars 30 forks source link

2023.9 custom-more-info: null is not an object (near '...elector("ha-dialog") #105

Closed Mariusthvdb closed 1 year ago

Mariusthvdb commented 1 year ago
Logger: frontend.js.latest.202309080
Source: components/system_log/__init__.py:269 
First occurred: 10 september 2023 om 16:54:29 (30 occurrences) 
Last logged: 07:48:52

Uncaught error from Safari 16.6 on Mac OS 10.15.7 Script error. null @:0:0
Uncaught error from Safari 16.6 on Mac OS 10.15.7 TypeError: null is not an object (near '...elector("ha-dialog")...') updateMoreInfo (/local/resources/custom-ui/custom-more-info.js:19:43) dispatchEvent ([native code]::) event (src/common/dom/fire_event.ts:76:21) nextRender (src/components/ha-expansion-panel.ts:131:14)

happening after updating to the 2023.9 version. need to explore what.why.when

quick check shows the error to occur when clicking an entity, to reveal the more-indo panel itself, and not, as I expected, to occur when opening the attributes box in a more-info panel, which causes the script triggering expanded-changed event

also, it does not happen on all entities. which makes it a bit difficult to debug quickly nor does it seems to happen in Chrome at all, only seeing it in Safari /Mac for now.

WarC0zes commented 1 year ago

Hi, under chrome, I receive this error. With the 2023.9.1 version.

Logger: frontend.js.latest.202309080
Source: components/system_log/__init__.py:269
First occurred: 06:00:04 (3 occurrences)
Last logged: 10:36:29

Uncaught error from Chrome 116.0.0.0 on Windows 10 TypeError: Cannot read properties of null (reading 'shadowRoot') updateMoreInfo (/hacsfiles/custom-ui/custom-ui.js:53:7) dispatchEvent (src/common/dom/fire_event.ts:76:7) nextRender (src/components/ha-expansion-panel.ts:131:14)
Uncaught error from Chrome 116.0.0.0 on Windows 10 TypeError: Cannot read properties of null (reading 'getElementsByClassName') updateMoreInfo (/hacsfiles/custom-ui/custom-ui.js:54:7) dispatchEvent (src/common/dom/fire_event.ts:76:7) nextRender (src/components/ha-expansion-panel.ts:131:14)
Mariusthvdb commented 1 year ago

right, so it appears in chrome also.

can you pinpoint it to a certain action? its apparently cant find that dom path m even though that is correct as far as I can see, and, also functional

might be a timing issue?

Mariusthvdb commented 1 year ago

ie just removed all of custom-ui and still see the frontend error..

Logger: frontend.js.latest.202309080
Source: components/system_log/__init__.py:269 
First occurred: 11:35:13 (11 occurrences) 
Last logged: 14:33:52

Uncaught error from Safari 16.6 on Mac OS 10.15.7 Script error. null @:0:0

I didnt see the custom-ui related line we both quoted though.

also, it seems to occur when this is also logged in the inspector

Scherm­afbeelding 2023-09-12 om 14 34 02

guess we need to report the back to the core Frontend devs.

please can you confirm also seeing the errors without custom-ui loaded?

also, there's a thingy with history-explore card that might occur at the same time see this in the community

hope that will be fixed soon too by Alex, testing as we speak

WarC0zes commented 1 year ago

I'm trying to inspect what's causing the error, but I can't see what it is. Exactly, I use history-explorer-card and this morning I made a card with it.

Mariusthvdb commented 1 year ago

I've just tested the HE dev card, and that fixed an issue there.

still want to rule out custom-ui too ;-) could you please disable the resource and check if its gone from the installed custom cards, refresh, and see if the error is gone?

WarC0zes commented 1 year ago

still want to rule out custom-ui too ;-) could you please disable the resource and check if its gone from the installed custom cards, refresh, and see if the error is gone?

The problem is that I can't reproduce the error. Despite trying, I don't know what action causes it. I'll keep you posted, by deactivating custom-ui and seeing if I can get the error.

WarC0zes commented 1 year ago

I updated to 2023.9.2 and history-explorer-card v1.0.50, I no longer have any errors.

Mariusthvdb commented 1 year ago

great! ok to close this then, but please keep an eye out, we need to tread carefully ;-)