thomasloven / lovelace-card-mod

🔹 Add CSS styles to (almost) any lovelace card
MIT License
1.08k stars 168 forks source link

fix error when setConfig is read-only #202

Closed a-p-z closed 9 months ago

a-p-z commented 2 years ago

When the method setConfig is read-only card-mod crashes. I wrapped the variable Assignment in a try-catch.

card-mod.js:5 Uncaught (in promise) TypeError: Cannot set property setConfig of #<z> which has only a getter
    at card-mod.js:5:1163
thomasloven commented 1 year ago

When does this happen?

a-p-z commented 1 year ago

It happens when a card defines setConfig as read-only. In this case the visual editor crashes. I noticed the issue in a card I created, using svelte. Svelte makes the exported function read-only.

thomasloven commented 9 months ago

Thanks! I'm really sorry it's taken so long.