-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Javascript from custom_components not included when casting #11087
Comments
cast documentation |
Hey there @emontnemery, mind taking a look at this issue as it has been labeled with an integration ( |
@emontnemery Maybe I haven't explained this correctly, but it seems this has to be a cast issue. The issue only appears when casting and seems to have started after the latest Cast changes. |
Not sure if this could help... I haven't changed anything over the weekend in HA, but magically all my custom buttons worked on my Google Hub yesterday. They had stopped working by the time I woke up this morning. |
So I managed to bandaid this issue. I realized that I was using another custom component (card-mod) and hadn't added duplicated the Resource using the /local/ path. Since this works everywhere else, I really think this has to be a Cast issue. |
Confirming that I have the same issue as @flyize and just like him all my custom elements work perfectly when viewed on web/mobile, however when using the cast feature to show a specific lovelace view on the Google Nest Hub i receive the "Customer Element doesn't exist", i can also fix this with the same bandaid by duplicating the resource using the /local/ path (which introduces other issues). |
Make sure your cors rules include |
Can also confirm I'm having this exact issue. I reconfigured configuration.yaml and restarted HA:
Still seeing the same issue. |
I had already added this and tested it prior to posting, same as @fiskhest above. Let me know if I should test anything else. |
BTW, I'm not sure the title is accurate description of the problem. Does anyone know if there is a way to get Chrome dev tools to work on the hub? |
What files are you trying to load? Files in the |
In my specific case, I'm using this (https://github.com/custom-cards/button-card) button card, as well as card-mod. While installed via HACS, I've removed the HACS Resource entries and replaced them with /local/ entries. This works intermittently, even though I've made no recent changes. |
please help have the same issue. I have HACS but it is not appears in the HA how can I rewove it ? |
I have this issue as well with layout-card and Stack In Card. |
I'm not able to reproduce, things just work here. Could it be that it takes too long to load the custom resources? If you switch to a different view and then back, does it then work? |
I just created a view with a single entity and got the same error. |
That is not what I meant, cast a view, navigate to another view on your cast device and see if the error is also there on the second view. |
At the risk of sounding really dumb, I don't have any navigation when I cast. What am I missing? |
If you are casting to a touch device you can use the type: button
tap_action:
action: navigate
navigation_path: /lovelace/0 Otherwise calling a Lovelace cast service call with another view, or a Lovelace cast row, (https://www.home-assistant.io/lovelace/entities#cast) will also work. |
Yeah, I realized that I do have a view with some navigate buttons. Seems those don't work at all. |
I was able to bring the casting back to working when I moved away from the layout-card addon. Same thing when I moved away from grouping together some cards with Stack in Cards, the individual cards came back with no problems. |
As a test mentioned a couple posts ago, I used a single button and it was still broken. edit: and just to show how intermittent it can be, my display is working fine this morning. In no more than a couple hours, it will be broken again though. And if it matters, navigation still doesn't work. |
I'm happy to report, that although I've changed nothing, this has been working the past couple of days. Even before the 2022.2 update it was working. So maybe Google fixed something? Here's my versions. As a random rant, why aren't new HA versions using the leading zero so that computers can easily sort them? It should version 2022.02 darnit! |
I knew I shouldn't have said anything. After a couple days of working perfectly, everything is broken this morning again. No changes on my end... |
It seems I need to fall on my own sword here. I was going through my custom_components the other day and found a 'cast' folder. I've no idea why I added that at some point, but since I removed it - things have been flawless. I'm sorry for this bonehead move. |
I think this is my problem. I use the lovelace-layout-card This is my view in full:
|
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. |
I'm still having this issue as of 2022.6.2 |
I'm also having this issue with many of my HACS Frontend cards when casting. Essentially none of them work, is everything really taking long to load? Wifi in the house is pretty excellent and even small cards wont load. |
same here with frigate-card |
Same problem with custom:clock-weather-card when casting to Nest Hub |
Still happens on 2022.12.6 with custom:flower-card installed through HACS. |
I have a view that is about 95% custom cards (clock-weather, platinum-weather, apexcharts, tabbed-card, team cards, etc etc) and it was completely fine until I added a new card yesterday. The other cards are still fine, but the new card is throwing the I added the new plant integration and associated card yesterday. The existing cards all work fine on both devices, but the new card is returning Nothing else has changed, the cast address is (still) included in CORS, served over https, etc. Everything else works fine, just not the new card. |
Also having the same issue, HA install is a week old and i've never managed to get custom cards to cast on google home display. I either get Custom element doesn't exist or the card doesn't show up at all depending on how I configure the resources and place the cards. |
The same problem with home assistant 2023.2.5 when casting a grid layout to Nest hub |
The same problem with HA 2023.2.5! Worked perfectly with previous HA versions |
Still having the same Problems. Everything works fine on App or Web interface. Cast to Google Nest results in this error. Current Version: |
The issue persists through: This only appears in cast. It really seems it has to be a cast issue. :) |
I also had this exact issue from time to time. But now all my six Nest Hubs are returning this error all the time. |
same problem with the cards listed above - frigate-card, mini-graph-card as examples. |
Is @emontnemery still the code-owner for cast? Been some time w/out a resolution. Certainly appreciate the help, but also would love to get this issue(s) resolved. Thx! |
Since it has been a year and a half, can we revisit the workarounds? Is the CORS stuff still relevant in 2023.7? For moving from HACS to local are we talking about moving every directory and file under config/www/community up one level to config/www? |
I had the exact same issue. The working solution for me was to add alternate path for the JavaScript resource ( Settings -> Dashboards -> 3 dots -> Resources ) If you have an existing path Add another one with the path Also remember that the cache on the Cast device may miss lead you, try rebooting the Cast device, or change the url of the dashboard view in HA |
That progresses me from the doesn't exist error to a blank white page (initially with the little "browser mod" finger in the corner). I'm casting to a Nest Hub Max. I can cast the Overview successfully so I believe I'm using the cast service correctly, I just can't get my ui-lovelace-minimalist view to work. Both of my very old Chromecasts show the same blank white page. |
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. |
Seems this has regressed in 2024.2 - "Custom element doesn't exist" on casting for elements such as mushroom-climate-card (and other custom cards) |
Experiencing similar issue with https://github.com/thomasloven/lovelace-layout-card on 2024.2 (and previous 2 monthly versions) |
I'm getting similar issues with both bubble-card and swipe card, regardless of if installed via HACS or manually in local (and manually adding to Resources). |
Happening here as well on a fresh install of Home Assistant attempting to cast a single custom card. |
Same problem here. Seems it's not loading any local content as my images and background are missing, and bubble-cards "don't exist" |
The problem
When casting lovelace views, .js from (some?) custom components isn't included. Instead you get an error that the custom element doesn't exist. The same view works correctly from a desktop.
I initially noticed this and found the following thread that suggested the way HACS gzips files might be causing the problem. The fix was to remove the HACS entry from Resources and recreate it using the /local/ path. That seemed to work until recently (maybe sometime this month)? I know there were some casting fixes implemented, so maybe its related?
My specific issue is regarding button-card, but according to this old thread, it effects many others as well.
https://community.home-assistant.io/t/custom-element-doesnt-exist-but-only-when-casting/140458
What version of Home Assistant Core has the issue?
cire-2021.12.7
What was the last working version of Home Assistant Core?
No response
What type of installation are you running?
Home Assistant OS
Integration causing the issue
cast
Link to integration documentation on our website
https://www.home-assistant.io/integrations/cast/
Example YAML snippet
No response
Anything in the logs that might be useful for us?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: