config-template-card icon indicating copy to clipboard operation
config-template-card copied to clipboard

Custom element doesn't exist: config-template-card

Open jmcollin78 opened this issue 2 years ago • 10 comments

Checklist:

  • [X] I updated to the latest version available
  • [X] I cleared the cache of my browser

Release with the issue: 1.3.6

Last working release (if known):

Browser and Operating System: Chrome. MacOS Monterey 12.1

Description of problem: After successful installation with HACS, I try to use the card. I manually insert the following card code:

type: custom:config-template-card
entities:
  - light.lampe_entree_1
card:
  type: entities
  entities:
    - entity: light.lampe_entree_1
      name: Ca roule ?

And Whatever I do I've got the error:

Custom element doesn't exist: config-template-card.
type: custom:config-template-card
entities:
  - light.lampe_entree_1
card:
  type: entities
  entities:
    - entity: light.lampe_entree_1
      name: Ca roule ?

Javascript errors shown in the web inspector (if applicable): No specific errpr


Additional information: Of course light.lampe_entree_1 exists. I read this post https://github.com/iantrich/config-template-card/issues/76 which is the same kind of problem

jmcollin78 avatar Jan 23 '22 10:01 jmcollin78

Hi, one more with the same issue like @jmcollin78

miglor-bcn avatar Jan 31 '22 13:01 miglor-bcn

I also have this issue with HA core 2022.2.9

ghost avatar Feb 28 '22 20:02 ghost

I'm unable to replicate. I'm on 2022.3.0 and things are working as expected

iantrich avatar Mar 03 '22 16:03 iantrich

Also having this issue on 2022.5.5

TheRealBenForce avatar Jun 01 '22 02:06 TheRealBenForce

I had this issue after installing with HACS and I restarted core and it then worked fine

gasman1844 avatar Jun 18 '22 12:06 gasman1844

Same here. Installed manually to www/config-template-card/ Then added lines to configuration.yaml at resources Still it does not work

HA 2022.12.1

Yari117 avatar Dec 25 '22 15:12 Yari117

I had this problem. I fixed it with some fumbling and stumbling. I tried to figure out exactly what made it work, but I can't get it to break again to figure out what actually fixed it.

I'm using config-template-card version 1.3.6, manually installed with Home Assistant 2022.11.4 and Frontend 20221108.0 - latest. I'm using Firefox 104.0.2 on Linux Mint.

While I was doing this, I learned two things:

  1. If you have trouble loading a resource (like config-template-card), browser caching might be causing it to use an older version of the code. Adding ?v=<something> to the end of the resource_url will supposedly force the code to reload. It doesn't matter what is as long as it's something you haven't used before. For example, this is from my lovelace_resources.yaml:
- url: "/local/config-template-card.js?v=7"
  type: module

?v=7 just means I did 7 experiments, starting at ?v=1 and going up.

  1. If you're changing resources, you also need to refresh the browser to make sure the new code loads. I was just leaving my test page open in the browser and restarting my hass docker container every time I edited lovelace_resources.yaml. This wasn't enough to load the new JavaScript code. I also needed to F5 to refresh the page.

Because I didn't know these things an hour ago, I can't be sure what exactly I did to make it work. I do have some theories:

  1. It's possible that adding ?v=1 to the url in lovelace_resources.yaml fixed it. I can't be sure because I didn't refresh my browser.

  2. It's also possible that I fixed this by opening a browser tab and loading http://automation.localdomain:8123/local/config-template-card.js (automation.localdomain is my home assistant install). I did this because I wanted to see if some permission problem was preventing the file from being served, but it's possible that this forced a preload or refreshed a cache somewhere.

  3. As part of my experiments, I tried reverting config-template-card.js to version 1.3.5 to see if something in 1.3.6 caused this bug. Because of the two things I learned above, I'm not sure if this did anything. I seems to work well with 1.3.5 or 1.3.6 now. (BTW, awesome size improvement from 1.3.5 to 1.3.6 @iantrich! 160 KB to 67 KB! I assume this was because of your dependency changes.)

I'm guessing that theory # 1 (adding ?v=1) fixed it for me. It's possible that it was theory # 2. I doubt it was # 3.

BertKleewein avatar Jan 28 '23 18:01 BertKleewein

I also have it (#126)

Aaroneisele55 avatar Apr 18 '23 03:04 Aaroneisele55

I also have it

resultzh avatar Aug 22 '23 15:08 resultzh

I just had this problem and I think I know what the problem is.

It only shows this when the config-template-card syntax is not correct. If anything is slightly wrong then this error shows up, and it highlights all code related to config-template-card as error.

victor-popescu90 avatar Jan 29 '24 20:01 victor-popescu90