home-assistant-custom-ui icon indicating copy to clipboard operation
home-assistant-custom-ui copied to clipboard

Uncaught TypeError: Cannot read property 'querySelectorAll' of null

Open JohanLeirnes opened this issue 7 years ago • 9 comments

Checklist

  • [x] I'm running the latest version of CustomUI (Update guide) or using a specific release that is not marked as "Broken".
  • [x] I tried to force-refresh (Ctrl+Shift+R / Ctrl+F5) the browser
  • [x] (Optional, but recommended) I'm using Chrome or tried to reproduce the feature on Chrome.

Chrome - 64

20180216

0.64.1

Getting this error whenever i load the frontend: 2018-03-01 16:21:21 ERROR (MainThread) [frontend.js.latest.201802090] https://yeitso.duckdns.org:8001/local/custom_ui/state-card-custom-ui.html:1:3665 Uncaught TypeError: Cannot read property 'querySelectorAll' of null

JohanLeirnes avatar Mar 01 '18 16:03 JohanLeirnes

@bhaap I also get this error. Thank you for documenting it.

Chrome 64 HomeAssistant 0.64.2

finish06 avatar Mar 02 '18 14:03 finish06

I can't reproduce this. Do you load customui via customizer as local / hosted? or via extra_html_url? If you use customizer, could you try to replace local with debug? If you use extra_html_url try https://raw.githubusercontent.com/andrey-git/home-assistant-custom-ui/master/state-card-custom-ui-dbg.html

andrey-git avatar Mar 02 '18 15:03 andrey-git

This is the responding error I now get after changing local to debug. 2018-03-02 14:28:56 ERROR (MainThread) [frontend.js.latest.201802270] http://hass:8123/frontend_latest/core-363542209d478158788109f8cf3068e8.js:1:6882 Uncaught TypeError: Cannot read property 'attributes' of undefined

finish06 avatar Mar 02 '18 20:03 finish06

I get this error too. On two hosts. Same versions on each. Latest while running 0.64.3

edif30 avatar Mar 08 '18 23:03 edif30

Everyone, those might be separate issues: one in customui and one in core.js @finish06 could you confirm you get an error in customui when you use local?

andrey-git avatar Mar 09 '18 05:03 andrey-git

@andrey-git It was when using local.

customizer:
   custom_ui: debug

Since changing the custom_ui to debug, the error has not occurred.

finish06 avatar Mar 14 '18 17:03 finish06

Does it come back when you change it back to local?

In any case

http://hass:8123/frontend_latest/core-363542209d478158788109f8cf3068e8.js:1:6882 Uncaught TypeError: Cannot read property 'attributes' of undefined

is expected when opening a non-existing view, i.e: http://hass:8123/states/bad_view_name

andrey-git avatar Mar 16 '18 19:03 andrey-git

So in the latest release im getting this again. I switched from using extra_html_url to using customizer and that fixed the issue. atleast for a day. (the other time I switched from custumizer to extra_html_url and that fixed it until this latest hass release) Now im getting this error again. But only on certain views.

Here is a video of me showing the error. https://youtu.be/WAhtL6uIeaQ

JohanLeirnes avatar Jul 02 '18 22:07 JohanLeirnes

I get this error too my platfrom: windows 8 HA0.77
my config: homeassistant: name: Homebolin latitude: 29.084455 longitude: 119.654027 elevation: 7 unit_system: metric time_zone: Asia/Shanghai #customize: !include customize.yaml #packages: !include_dir_named packages customize_glob: ".": custom_ui_state_card: state-card-custom-ui-es5

customizer: custom_ui: local hide_attributes: - node_id - value_index

frontend: extra_html_url: - /local/custom_ui/state-card-custom-ui.html extra_html_url_es5: - /local/custom_ui/state-card-custom-ui-es5.html

config: history: logbook:

jia175891641 avatar Oct 05 '18 07:10 jia175891641