Skip to content
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

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

Open
2 tasks done
jmcollin78 opened this issue Jan 23, 2022 · 10 comments
Open
2 tasks done

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

jmcollin78 opened this issue Jan 23, 2022 · 10 comments
Labels
bug Something isn't working

Comments

@jmcollin78
Copy link

jmcollin78 commented Jan 23, 2022

Checklist:

  • I updated to the latest version available
  • 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 #76 which is the same kind of problem

@jmcollin78 jmcollin78 added the bug Something isn't working label Jan 23, 2022
@miglor-bcn
Copy link

Hi, one more with the same issue like @jmcollin78

@ghost
Copy link

ghost commented Feb 28, 2022

I also have this issue with HA core 2022.2.9

@iantrich
Copy link
Owner

iantrich commented Mar 3, 2022

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

@TheRealBenForce
Copy link

Also having this issue on 2022.5.5

@gasman1844
Copy link

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

@Yari117
Copy link

Yari117 commented Dec 25, 2022

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

@BertKleewein
Copy link

BertKleewein commented Jan 28, 2023

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.

@Aaroneisele55
Copy link

Aaroneisele55 commented Apr 18, 2023

I also have it (#126)

@resultzh
Copy link

I also have it

@victor-popescu90
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

10 participants