Stuck on "custom element doesn't exist" - need help!

The problem for me turned out to be faulty .js files. After I made sure that these were downloaded and saved properly, it has worked for me in all browsers.

What was new to me was the “Raw” option on Github that I hadn’t discovered before. If you click to view a .js file, there are 3 buttons at the top right of the view. Clicking on “Raw” opens a plain text view of that file. Select all with Ctrl-A and copy it. Paste it into any text editor and save the file with the correct filename [filename.js] in the /config/www/ folder of HA. You should then have the correct .js file in place and referencing it with the correct path in the ui-lovelace.yaml should then work.

1 Like

For me the problem was a wrong word… :0)

Before…

sources:
  - url: /local/tracker-card.js?v=0.1.5
    type: js
  - url: /local/monster-card.js?v=0.2.3
    type: js

…and after

resources:
  - url: /local/tracker-card.js?v=0.1.5
    type: js
  - url: /local/monster-card.js?v=0.2.3
    type: js
2 Likes

Just wondering if anyone can help me with the same issue but I’m only experiencing it on an older iPad when using some custom cards, works fine on a newer ipad/laptop etc…

1 Like

@scottdarby - Same here, I’m running an old device with IOS9 and this error appears on that device only. I have tried mobile safari, mnobile chrome, and also the native IOS HA app. All other devices work fine, its just the IOS 9 device…did you get to the bottom of this?

Same here, works on my PC and new iPad, iPhone, but not on the old iPad with IOS9

So, I tried out a new card and it gave me this problem. I’ve removed all trace of it, but when I restarted, it somehow had infected my button-card which had been working fine and had nothing changed. Now the button-card refuses to load. How can a card go from working to not working with no change? All my other custom cards are still working fine. Argh. Any ideas?

I have the same problem here, it worked 2 hours ago and now it just refuses to load. Don’t know what to do and/or what the problem could be. I have tried restarting Home Assistant and reloading the config several times but to no avail.

Same for me. There is maybe a fix here:

https://github.com/kuuji/button-card/issues/43

1 Like

I just did this and it fixed the problem for me, go to your button-card.js file (default location /local/button-card.js, local is the www folder in your homeassistant installation) and edit the file with any text editor. Then replace line 3 with this address:

https://unpkg-gcp.firebaseapp.com/@polymer/[email protected]/lit-element.js?module

Then save and restart Home Assistant (don’t know if you have to restart it but I did it anyways :stuck_out_tongue:). When everything is back online refresh the page a few times as it will take a few tries. If it doesn’t clear out your browser cache and try again. They work fine for me now. Hope this helps.

2 Likes

I suspected that little URL would be the one that kills it, if this works I owe you a case of beer! Will try it toight! Thank you!!

Had same issue, this fix worked.

So I tried that, the first time it didn’t change anything. I tried to clone it again from github and edit it again, and change that URL. Then I rebooted my Pi. When I came back the whole tab crashed and I got the following error in my log from yet another custom component that didn’t have any changes whatsoever, calendar-card.

https://MYHOST/local/custom_ui/calendar-card/calendar-card.js?v=1.0.1:10:7 Uncaught ReferenceError: moment is not defined

Are the cards somehow screwing up each other’s dependencies? First vertical stack in card started it (see my ticket below)

Then button card went down…

And now calendar card…

What’s happening?

Okay, I commented out calendar card, reloaded, and reactivated and reloaded and it came back… Maybe just an anomaly… But button card is still out of commission…

Ok wow, so now I put the old button card back (same one I had when this whole mess started), and now it works again… Arghhh… I guess it’s solved for now, but what the heck is going on here?

It is because the custom-button card uses an external resource which wasn’t working yesterday (for some reason). Putting in the line I shared earlier did fix it for me. But probably the original source is working again. After putting in the line I shared (or reinstalling) you should clear out your browser cache first.

1 Like

Any way I can just copy the external resource into the card? I don’t like depending on external web sites to work for my hass to work…

I would like to know that as well, or maybe the source could be implemented in HA itself so we don’t have to rely on these sources (I have seen more cards make use of these sources).

Btw I opened my mobile app today and button card was broken again :-(. Also broken on my work computer, but on my home computer it’s still working… I’ve tried clearing cache multiple times but it’s not coming up on any other devices but my home computer…

They work fine for me on all devices since I have used the fix I have posted earlier. Did you try that?

Yes I did and it didn’t work, even after rebooting the whole server and clearing cache and restarting the browser… I guess I can try it again…