dmulcahey / zha-network-visualization-card

Lovelace custom element for visualizing the ZHA Zigbee network
36 stars 20 forks source link

‘Custom element doesn’t exist:zha-network-visualization-card’ #23

Open rayperkins1 opened 4 years ago

rayperkins1 commented 4 years ago

Thank you for making this, it is really helpful in troubleshooting.

I was getting this error when trying to add the card to lovelace: ‘Custom element doesn’t exist:zha-network-visualization-card’

I was able to get zha-network-card to work, so I seemed to be doing something right. While trying to understand if the name of the custom card is from the java-script filename or from something in the file I noticed both zha-network-card.js and zha-network-visualization-card.js had a line like: customElements.define("zha-network-visualization-card",ZHANetworkVisualizationCard); But in the working zha-network-card.js file it was all on one line, while the visualization js had it on multiple lines. I edited the zha-network-visualization-card.js file so that it is on one line and now it works for me.

Maybe there is something else changed between my last failed attempt and this success but I thought I it was worth mentioning.

Here is a diff between the original and my edits:

www $ ls
zha-network-card.js                     zha-network-visualization-card.js
zha-network-visualization-card          zha-network-visualization-card.js.old2
www $ diff zha-network-visualization-card.js.old2 zha-network-visualization-card.js
--- zha-network-visualization-card.js.old2
+++ zha-network-visualization-card.js
@@ -210,7 +210,4 @@
   }
 }

-customElements.define(
-  "zha-network-visualization-card",
-  ZHANetworkVisualizationCard
-);
+customElements.define("zha-network-visualization-card",ZHANetworkVisualizationCard);
www $
brgerig commented 4 years ago

I'm having the same problem. Using your edit unfortunately didn't fix it for me. I also tried rename the .js.gz file, and using /local/community/zha-network-visualization-card/zha-network-visualization-card.js instead of /hacsfiles/zha-network-visualization-card/zha-network-visualization-card.js.

fpschrisiom commented 4 years ago

I copied the folder up a level and it instantly started working \www\zha-network-visualization-card\

Bodge-IT commented 4 years ago

I managed to get everything installed but mainly got the above error. When I actually got it running - no idea how - I actually get a date-time output (1970-01-01 00:00:00) with an empty form field... no visualization

harbri commented 4 years ago

I'm also experiencing this issue after installing the integrations en custom card using HACS. Tried all suggestions mentioned above but without result. Also checked permissions but nothing wrong with that. Keep getting the error....

Screenshot 2020-07-27 at 18 57 28 Screenshot 2020-07-27 at 18 57 56

dmulcahey commented 4 years ago

@harbri What you installed is another card not this one... Look at the name of this repo and the files and look at the URL you have. This component is not on HACS. You installed my other card that shows a table of devices.

harbri commented 4 years ago

Yep, you're right. Stupid mistake of me! Installed your other card and it's working now. Thanks.

Bodge-IT commented 4 years ago

My install just started working all of a sudden. I see now the date info is actually a recent date. Maybe just needed a little more patience.