Custom Lovelace Cards not working

I have added a few custom cards (mini graphs and monster card) through HACS and I can’t seem to get them working. I added the resource lines in the raw config and I get the following error when I try to add the cards. They bother give the same error-

Cannot read property 'setConfig' of undefined

Not sure how to fix this. I’ve tried looking up the error, but can’t seem to find anything.

1 Like

In the absence of anybody who has had this specific problem…

Can you include what you’ve got in the resources section? And confirm that you have downloaded the source to the config/www folder? It would also be worthwhile trying with both type: module and type: js.

I did this through HACS, so everything was downloaded for me.

resources:
- type: js
url: /community_plugin/monster-card/monster-card.js
- type: module
url: /community_plugin/mini-graph-card/mini-graph-card-bundle.js

Capture

I’m having the same issue. Looking at the log, something in the .js seems broken, so it cannot be loaded in lovelace.
ex:

https://XXXXXXX.duckdns.org/local/battery-entity.js?v=0.1:56:10 Uncaught SyntaxError: Unexpected identifier

It seems that JS is broken at line 56, column 10 .
Currently trying to fix it

Hi! Found this topic searching for very same error I’m getting with various custom components. Strange behavior is that these seems to work, if were configure previously, but if I want to add new card with the same configuration I get an error Cannot read property ‘setConfig’ of undefined.
I noticed this for custom weather card, for mini-graph-card and also ESXi integration. Not sure at which moment this error occurred, since I had hassio SD card crash and had to restore whole configuration… Given the number of components failing, I’d assume it is not related to specific one, but rather something to be broken in hassio itself… Any idea?

I found my problem… while doing copy/paste of working config I forgot to remove dash from before first line :man_facepalming:

5 Likes

@stallion11885
Have you found a solution to this problem?
None of my mini graphs are working, but the mini-player seems to be fine (both installed via HACS).

Try and remove the first 2 characters from each line.

So instead of this-

- type: custom:monster-card
  show_empty: false
  card:
    type: glance
    title: Lights On
  filter:
    include:
      - domain: light

Try this-

type: custom:monster-card
show_empty: false
card:
  type: glance
  title: Lights On
filter:
  include:
    - domain: light
7 Likes

This fixed it for me. Thanks!

It worked! Thank you