nathan-gs / ha-map-card

A Map Card for Home Assistant
https://community.home-assistant.io/t/map-card-a-slightly-improved-map-card/693088
MIT License
15 stars 4 forks source link

Error found in first run, check Console #69

Closed s3anyboy closed 1 week ago

s3anyboy commented 2 weeks ago

I see the message "Error found in first run, check Console" where the attributions listed, but I have looked in the logs and dont see anything related to this, even with debug: true in the card

nathan-gs commented 2 weeks ago

And what does the browser console say? https://www.jivrus.com/resources/articles/technical/how-to-open-browser-console-log

ildar170975 commented 1 week ago

Started testing 1.4 today, managed to get a similar issue: image

map-card.js?hacstag=734825457140:14865 TypeError: Cannot read properties of undefined (reading 'attributes')
    at map-card.js?hacstag=734825457140:15862:20
    at Array.map (<anonymous>)
    at MapCard._firstRender (map-card.js?hacstag=734825457140:15853:39)
    at MapCard.render (map-card.js?hacstag=734825457140:15734:32)
    at MapCard.update (map-card.js?hacstag=734825457140:14550:236)
    at MapCard.performUpdate (map-card.js?hacstag=734825457140:14537:5001)
    at MapCard.scheduleUpdate (map-card.js?hacstag=734825457140:14537:4535)
    at MapCard._$ET (map-card.js?hacstag=734825457140:14537:4443)

But this happened with a wrong card's code - entity was deleted accidentally while typing: image

nathan-gs commented 1 week ago

@ildar170975 that's more or less the intended behavior.

ildar170975 commented 1 week ago

@nathan-gs I fully agree; may be the OP missed some required attribute?

nathan-gs commented 1 week ago

Closing the issue @s3anyboy, but please reopen if you have more info.

ildar170975 commented 1 week ago

Another case - defining a non-existing entity: image

or an entity w/o coords: image

I wonder - if a person is at home - then the entity does not have coords - then will we see an error?

s3anyboy commented 1 week ago

Another case - defining a non-existing entity: image

or an entity w/o coords: image

I wonder - if a person is at home - then the entity does not have coords - then will we see an error?

Yes, I have custom device_trackers to merge multiple location sensor sources and sometimes they do not provide GPS coords, so it seems this was the cause of the issue.

in 1.3.0 the map at least still loaded despite displaying this error, but after update to 1.4.0 the map is just a black/white screen if the problem entity is defined. Not sure what can be done about this exactly, I will probably just have to stay on 1.3.0 for a while lol, thanks though.