Uncaught TypeError: Cannot read property 'some' of undefined

Hi,
I wanted to share some knowledge. So I’ll answer my own question, if that’s permitted.
So, I was getting:
http://192.168.X.X:8123/frontend_latest/a165dd73e19a69791eb4.chunk.js:629:478 Uncaught TypeError: Cannot read property 'some' of undefined
everytime I switched over a specific tab on the Lovelace UI. I could also see a message on the bottom saying:

Service system_log/write called.

I searched on Google, but found nothing. Upon debugging and struggling for a coulpe of hours, I figured it out.
It occurs when you’re trying to access a domain (group, device, etc) that doesn’t exist.

Example:
In lovelace-ui.yaml you have a entity called: “group.downstairs”, but that group doesn’t exist in the groups.yaml. Or similar.

This fix worked for me. Thanks for posting it.

1 Like

This error occurs in Chrome Browser when you read a property or call a method on an undefined object . Uncaught TypeError: Cannot read property of undefined error is probably easiest to understand from the perspective of undefined, since undefined is not considered an object type at all (but its own undefined type instead), and properties can only belong to objects within JavaScript. There are a few variations of this error depending on the property you are trying to access. Sometimes instead of undefined it will say null.

This should be a user readable error.

I’m a programmer and >I< didn’t knew what was causing it, only after a lot of trouble searching on my own for it.