"custom element doesn't exist" ... but only when casting

Basically everything is working fine through the web interface, however when casting I get the error “custom element doesn’t exist” for all of the custom controls that I have … any ideas what is going on?

Thanks

I have the exact same issue. Did you ever solve it @i00?

Same error here. Also did a forum post a couple of hours back. Thought it was related to my new reverse proxy maybe

I did … card-tools (that a lot of cards use) was the culprit … it has since been updated … update all your custom resources in lovelace.

Is card-tools a plugin? I don’t have it installed yet I’m seeing the same “custom element doesn’t exist” error when casting.

Some custom cards use the card-tools components internally (but mini-fied so that they don’t require a second resource link) … easiest to check with the card’s creator.

Same issue here - all custom resources uptodate (according to HACS)

I have the same issue only when casting (Google Display). All custom resources are up to date according to HACS. I do not have a separate card-tools component installed. Same problem with version 0.105.5 and 0.106.6
UPDATE: Issue was resolved after upgrading to HA version 0.107

Same here. Finally resolved on upgrade to 0.107 :blush:🤸

Nope … still happens in 107 … doesn’t seem to be as much though

This is still happening to me on 0.112.2. Has anyone found a fix?

Same issue here. Would love a resolution as the affected cards are mini-media-player, and I’d like to view what’s playing on my sonos on the androidtv :slight_smile:

Also have this issue, with every non-HA card I use (decluttering-card, simple-weather-card, auto-entities, atomic-calendar-revive, mini-media-player). Anyone know how to get it working?

I just got this error again. Solved it by adding custom elements to Lovelace manually. I just HACS for the custom elements and it ads the js files with /hacsfiles/ path. I just added additional with /local/community/ path. And then it works!

Example path for mini-graph-card: /local/community/lovelace-slider-entity-row/slider-entity-row.js

4 Likes

I tried this fix but it didn’t work for me. Still seeing “custom element doesn’t exist” although I confirmed both URLs (hacsfile/ and local/com…) are accessible via browser.
Screen Shot 2021-01-05 at 5.52.49 PM

Home Assistant 2020.12.2

Wow, thanks @corvy! I’m sure I must have seen this here before but didn’t understand it. I use YAML mostly, so didn’t know what your screenshot was of. But when I figured it out and tried it, your workaround/solution worked for me!
So, in my configuration.yaml I have things installed via HACS like the first part of my code example, but adding the bottom bit (after the comment) and refreshing meant that I could finally see these cards! I’m very thankful fo this :slight_smile:

lovelace: 
  mode: yaml
  resources:
  - url: /hacsfiles/lovelace-template-entity-row/template-entity-row.js
    type: module
  - url: /hacsfiles/button-card/button-card.js
    type: module
  # Duplicates needed for casting...
  - url: /local/community/lovelace-template-entity-row/template-entity-row.js
    type: module
  - url: /local/community/button-card/button-card.js
    type: module

@Bram_Kragten - knowing this, is there any way that we can update the cast integration so that the workaround of duplicating these resources with different paths is no longer required?

This worked for me too, but now all the scripts are also loaded twice (and executed twice!) everytime, which causes a lot of console errors. Is there a better way?

For anyone else encountering this; I went for a search as to why use both of the urls. It seems HACS applies some tricks to minimize the payload of js files through gzipping and disable caching, and it uses therefore the /hacs url’s. I deleted those and only use the /local/community urls instead, which works perfectly fine.
The only caveat is that the files served over /local/community aren’t gzipped, so they are a bit (a lot?) bigger, but they are cached which eliminates this to the first load only. One thing to keep in mind: when not using the HACS cache you might have to clear the cache when updating lovelace plugins.

2 Likes

I cannot cast the Dwains Dashboard Theme to my Google Nest Hub Max. I got this error:

I’ve manual added resources but I cannot get rid of the red box. Anyone suggestions?

Regards,
Bernd

It does work in a ‘normal’ browser?