You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My lovelace configuration method (GUI or yaml): YAML & GUI
What I am doing: Change themes programmatically in one of my custom cards
What I expected to happen:
not to spam the console with errors.
What happened instead:
the console is spammed with errors.
Minimal steps to reproduce:
change the theme dynamically using a button that calls "setTheme"
this is a code for the button:
const ev = new Event("settheme", {
bubbles: true,
cancelable: false,
composed: true,
});
ev.detail = { theme: "my-theme" }
this.dispatchEvent(ev);
# The least amount of code possible to reproduce my errorThe problem has nothing to do with YAML, it happens whenever the theme is changed programmatically.# End of code
Error messages from the browser console: Uncaught (in promise) SyntaxError: "undefined" is not valid JSON
I have debugged it and figured out the source of the error.
in the constructor you call:
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.
The text was updated successfully, but these errors were encountered:
My Home Assistant version: 2025.1.2
My lovelace configuration method (GUI or yaml): YAML & GUI
What I am doing: Change themes programmatically in one of my custom cards
What I expected to happen:
not to spam the console with errors.
What happened instead:
the console is spammed with errors.
Minimal steps to reproduce:
change the theme dynamically using a button that calls "setTheme"
this is a code for the button:
Error messages from the browser console:
Uncaught (in promise) SyntaxError: "undefined" is not valid JSON
I have debugged it and figured out the source of the error.
in the constructor you call:
in order to prevent this bug, I capture the event myself and stopPropagation so your event listener will not pop.
the bug occurs even after removing all card_mod instructions, just having card-mod installed and changing themes dynamically is enough.
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.
The text was updated successfully, but these errors were encountered: