question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Card backgrounds not loading reliably

See original GitHub issue

My Home Assistant version: 2021.11.1

My lovelace configuration method (GUI or yaml): GUI

What I am doing: Loading card backgrounds with card mod when navigating to Home Assistant.

What I expected to happen: Card backgrounds load.

What happened instead: Some card backgrounds load, some dont. see: https://imgur.com/a/VmBFWbi

It’s worse if I am using a slower connection like through Nabu Casa. Navigating to the page locally nearly always works as expected.

It’s often not the same cards. It occurs in both Chrome and Firefox and for a change Safari (iOS mobile app) is actually ok most of the time too (even when remote).

If I refresh the home view or clear the cache on the home view it may change which card backgrounds disappear but if I refresh the page on another view then switch to the home view it displays backgrounds correctly.

This only occurs when using 2021.11.1 downgrading to 2021.10.6 stops the issue occurring.

Minimal steps to reproduce: Navigate to Home Assistant

(themes.yaml)

day:
  card-mod-theme: day
  card-mod-card: |
    ha-card.top-level-card {
      border: solid 1px var(--primary-text-color);
      background: url("/local/background/card_bg_Day.png");
    }

(in each card)

card_mod:
  class: top-level-card

Error messages from the browser console: See the first image in the link above.


By putting an X in the boxes ([]) below, I indicate that I:

  • Understand that this is a channel for reporting bugs, not a support forum (https://community.home-assistant.io/).

  • Have made sure I am using the latest version of the plugin.

  • Have followed the troubleshooting steps of the “Common Problems” section of https://github.com/thomasloven/hass-config/wiki/Lovelace-Plugins.

  • Understand that leaving one or more boxes unticked or failure to follow the template above may increase the time required to handle my bug-report, or cause it to be closed without further action.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:2
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
thomaslovencommented, Nov 6, 2021

This is a timing issue that’s hard to fix.

There is something you can try, though. In your configuration.yaml add:

frontend:
  extra_module_url:
    - /local/wherever/card-mod.js

and then restart Home Assistant and clear your browser caches. This will make card-mod load before anything else, and let it do its magic in peace.

You will probably get an error in your browser console about something something undefined something themes something. This can be safely ignored, and I know how to fix it if this workaround works.

1reaction
thomaslovencommented, Nov 21, 2021

In the new release 3.1.0 this is now the recommended installation method.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cards not loading? : r/ptcgo - Reddit
I've noticed that sometimes it's better to not load the image. At times, before the image loads, I see the card text and...
Read more >
How to Repair SD Card Not Showing Up or Reading on Mac
Simultaneously hold on Control + Command + Eject/Power button. It is the most reliable option, as it's not dependent on the OS. select...
Read more >
Reasons Your Credit Card Isn't Working - The Balance
There's usually a simple explanation for why your credit card won't work. Find out if one of these reasons is the solution for...
Read more >
How to Fix: iPhone 12/11/Xs/X/8 Live Wallpaper Not Working
We will offer you 5 simple and also reliable solutions to help you fix the iPhone live wallpaper not working issue with great...
Read more >
Look! 5 Methods to Fix PNG Files Not Opening in Windows 10 ...
Have you encountered the problem of the PNG file not opening windows 10? ... You can see this kind of file on an...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found