Open karwosts opened 11 months ago
Same with these custom cards:
I suspect the vertical-stack/markdown card is probably not significant. It is probably just a timing sensitive issue that is perturbed by other cards.
If I just have the mini-graph-card alone on the page, and spam refresh button, about 50% of the time it is not loading, and 50% of the time it does. Probably some kind of race condition.
You are probably right, it may not depend on my conditions only.
I came to "vertical-stack/markdown" (same is with "vertical-stack/history-graph") after testing, noticed that in this case I have 100% failures; after placing a card (markdown
or history-graph
) out of vertical-stack
I usually saw it working... Could be a matter of errata.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment π This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
still valid
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment π This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
up
I am currently developing a card that, for me, always has this issue if I include it as the top-level card (i.e. not nested inside a stack). When the card is "not displayed", I can look at the devtools and see that it has an embedded error card with display: none
set on it. When I show the error card, it says "Custom element doesn't exist: combined-card" (the name of my card). I see that my card did load successfully on the page (and works correctly outside of edit mode). Best guess is that it is a race condition where the page is rendered before all custom components are loaded -- not sure how the regular view handles it, as this error does not appear to happen outside of loading a page in edit mode.
There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment π This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.
up
Checklist
Describe the issue you are experiencing
I was investigating some issues with custom cards and I feel like there may be something broken in the view construction phase for custom cards when the frontend in Edit mode. I suspect this is a frontend bug (and not an issue with the custom cards themselves) but I haven't exactly isolated what it is yet.
As I understand, the loading process for custom cards is:
hui-error-card
in its place, but set it todisplay:none
so that it is hidden.display:none
from thehui-error-card
to show the error.ll-rebuild
event to replace the error card with the custom card.https://github.com/home-assistant/frontend/blob/bffdfcf61c4833293e9782aef4bdcc7c7921152a/src/panels/lovelace/create-element/create-element-base.ts#L127-L130
When this event is fired, it first goes to the element to try to rebuild, but in edit mode we skip this and try to send
ll-rebuild
all the way up to thehui-root
:https://github.com/home-assistant/frontend/blob/bffdfcf61c4833293e9782aef4bdcc7c7921152a/src/panels/lovelace/views/hui-view.ts#L75-L81
What seems to be broken here in some cases is that when this
ll-rebuild
event is fired, in some cases thehui-error-card
does not have a parent element. For whatever reason it does not seem to be correctly linked in the DOM. Therefore thell-rebuild
event never triggers any action inhui-root
and is lost.https://github.com/home-assistant/frontend/blob/bffdfcf61c4833293e9782aef4bdcc7c7921152a/src/panels/lovelace/hui-root.ts#L545
The view is not rebuilt, and the
display:none
is not removed from the error card, so we're just left with a hole in the dashboard with a floating card-options bar:This seems to work for some custom cards and not others for some reason, and it seems sensitive to the card's position on the page, and what other cards exist on the page.
I debugged for a while but I could not isolate why sometimes the
hui-error-card
correctly had ahui-card-options
as its parentElement, and why sometimes thehui-error-card
had a parentElement ofnull
.Describe the behavior you expected
Custom cards will be rendered.
Steps to reproduce the issue
What version of Home Assistant Core has the issue?
2023.7
What was the last working version of Home Assistant Core?
No response
In which browser are you experiencing the issue with?
chrome, firefox
Which operating system are you using to run this browser?
No response
State of relevant entities
No response
Problem-relevant frontend configuration
Javascript errors shown in your browser console/inspector
Additional information
Related:
https://github.com/kalkih/mini-graph-card/issues/984 https://github.com/aukedejong/lovelace-windrose-card/issues/39 https://github.com/rejuvenate/lovelace-horizon-card/issues/57