Lovelace custom card not updating

Tags: #<Tag:0x00007fc423428ad0>

I’m trying my first lovelace custom card. When I make changes to the js file, they are not updating in the UI. Simple things like changing the text that is printed out. I’m using the content-card-example as a template. When I change the text it doesn’t get reflected on the UI. I’m tried the following.

  1. Flushed my browser
  2. remove the old card and re-added it

Any help will be appreciated.

did you figure this out - driving me mad too!

2 Likes

Anyone having any luck?

If you pop over to my front end repo for Philips hue icons you’ll find the JavaScript source includes a couple of things that might help.

  1. Including the file manually via your configuration.yaml:
  extra_module_url:
    - /local/your_script_name_here.js
  1. this addition to the javascript file which helps you identify which version you’re running in the console:
console.info(
    `%c HASS-HUE-ICONS  \n%c  Version 1.0.98    `,
    "color: orange; font-weight: bold; background: black",
    "color: white; font-weight: bold; background: dimgray",
);

The first is a useful way to force the script to load even before the dashboard gets selected. It means that if you open on the default dashboard, your script still runs. The second lets you look at the javascript console and see which version of the script (if any) is loaded.