sidebar-card
sidebar-card copied to clipboard
Cannot read properties of null (reading 'map')
ERROR (MainThread) [frontend.js.latest.202112290] https://xxxxxxx.duckdns.org:8123/hacsfiles/sidebar-card/sidebar-card.js?hacstag=2418255740184:462:5343 Uncaught TypeError: Cannot read properties of null (reading 'map')
I always get this error in my logfiles. Is this a known error?
I get the same
ERROR (MainThread) [frontend.js.latest.202204050] http://xx.xx.xx.xx/hacsfiles/sidebar-card/sidebar-card.js:462:5343 Uncaught TypeError: Cannot read properties of null (reading 'map')
+1 here using HA 2022.12.9:
2023-01-11 15:22:06.523 ERROR (MainThread) [frontend.js.latest.202212131] https://xx.xx.xx.xx/hacsfiles/sidebar-card/sidebar-card.js?hacstag=2418255740184:462:5343 Uncaught TypeError: Cannot read properties of null (reading 'map')
For the ones with this issue. I just debugged a bit, and seems that if you've empty template (so with some if checks etc.) and bottomline you don't have any matching condition, if your result is an empty string. It can't do the .map function on an empty string.
Temp fix for this, is just adding 1 line at the bottom of your template to always have at least 1
<li> </li>
@KentuckyMC this workaround worked for me. Thanks