"custom element doesn't exist" ... but only 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?

In a normal browser this doens’t work either.
When I cast the default lovelace dashboard it works, so it has to be something with the Dwains Dashboard Theme. I added manual the resources of the Dwains Dashboard but it stil doesn’t work.
I suppose the dwains-flexbox-card calls the card-tools card but my knowledge stops there… This is a link for Dwains Dashboard: Dwains Lovelace Dashboard | An auto generating Home Assistant Lovelace UI dashboard for desktop, tablet and mobile by Dwains for desktop, tablet, mobile

I use this blueprint: Cast and re-cast a lovelace view to a Google Hub for casting.

Still not having found what is causing ths error… and tried some things. When I cast from Google Chrome and select my Nest hub Max and choose cast tab then this works but it’s unusable (to small and no touch possibilities).

If I use the automation blueprint to cast then I get a the red box with the dwains-flexbox-card error.

hi - i’m having these issues and i don’t use HACS. i’m using mini-graph-card on my dashboard.
the mini-graph-card-bundle.js is stored in the www directory and pointed to as local/mini-graph-card.js in resources. works fine in browser when used locally or via nabu.casa.

i also noticed that even the normal graphs are not loading - those just keep spinning - i think that none of the dynamically loading javascript is making it through to the cast - or something.

Very similar problem here trying to cast Apexcharts.

I managed to get the charts to cast after removing the HACS apexcharts install and installing manually as @Devqon mentioned above, the charts now cast but no data, just says ‘Loading’ in each chart.

I’m still having this problem and opened a Github issue. Please add any additional data that I may have missed.

2 Likes