elchininet / custom-sidebar

Custom HACS plugin that allows you to manage Home Assistant's sidebar items per user or device basis
Apache License 2.0
22 stars 3 forks source link

TypeError: null is not an object (evaluating 'i.menuButton.style') #139

Closed Mariusthvdb closed 1 week ago

Mariusthvdb commented 1 week ago

logged after updating to 5.0.0: HA 2024.9.1

Logger: frontend.js.modern.202409060
Bron: components/system_log/__init__.py:333
Eerst voorgekomen: 10 september 2024 om 22:29:08 (22 gebeurtenissen)
Laatst gelogd: 14:52:23

Uncaught error from WebKit 605.1.15 on iOS 17.6.1 TypeError: null is not an object (evaluating 'i.menuButton.style') i (/hacsfiles/custom-sidebar/custom-sidebar-yaml.js:1:75483) /hacsfiles/custom-sidebar/custom-sidebar-yaml.js:1:76021 /hacsfiles/custom-sidebar/custom-sidebar-yaml.js:1:77894 message (node_modules/home-assistant-js-websocket/dist/connection.js:23:42) forEach ([native code]::) forEach (node_modules/home-assistant-js-websocket/dist/connection.js:15:25)

cant see any issues in the actual frontend, so not sure how to proceed finding the issue

sidebar-config.yaml: (note I added a JS and a Jinja template for testing purposes, and both work fine)

title: >
  [[[ 'Rumah kami: ' + new Date(states('sensor.date_time_iso'))
      .toLocaleTimeString().slice(0, 5) ]]]
sidebar_editable: >
  {{is_state('input_boolean.sidebar_editable','on')}}
order:
  - item: ui-overzicht
    match: data-panel
    order: 1
  - item: ui-data
    match: data-panel
    order: 2
  - item: ui-familie
    match: data-panel
    order: 3
  - item: ui-instellingen
    match: data-panel
    order: 4
  - item: ui-develop
    match: data-panel
    order: 5
  - item: /ui-cctv
    match: href
    order: 6
  - item: /energy
    match: href
    order: 7
  - item: ui-test
    match: data-panel
    order: 8
  - item: ui-configured
    match: data-panel
    order: 9

  - item: /logbook
    match: href
    hide: true
  - item: /lovelace
    match: href
    hide: true
#   - item: Overzicht
#     match: text
#     hide: true
  - item: history
    match: data-panel
    hide: true
  - item: calendar
    match: data-panel
    hide: true
  - item: todo
    match: data-panel
    hide: true
  - item: media
    hide: true
  - item: resources
    hide: true
  - item: config
    match: data-panel
    exact: true
    hide: true
  - item: developer-tools
    match: data-panel
    hide: true
elchininet commented 1 week ago

It didn't find the menu button in the header of the sidebar. I thought that it was always present, but I'll fail silently if for some reason it doesn't exist. I'll release a patch soon.

elchininet commented 1 week ago

@Mariusthvdb, A new version has been released with the patch. You should not see that error anymore with that version.