Olen / lovelace-flower-card

Lovelace Flower Card to match the custom plant integration

Home Page:https://github.com/Olen/homeassistant-plant/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Card not showing in UI editor - `uncaught (in promise)` error

hmmbob opened this issue · comments

Trying to setup this card through the UI, but it isn't showing at all to be selected. The console shows an error:

card-mod.js:5 CARD-MOD 3.2.2 IS INSTALLED
card-mod.js:5 You may not be getting optimal performance out of card-mod.
See https://github.com/thomasloven/lovelace-card-mod#performance-improvements
bar-card.js:4855   BAR-CARD   Version 3.1.7    

0:1 Refused to load the script 'https://unpkg.com/lit-element@3.0.1/lit-element.js?module' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

0:1 Refused to load the script 'https://unpkg.com/lit-html@latest/directives/unsafe-html.js?module' because it violates the following Content Security Policy directive: "script-src 'self' 'unsafe-inline' 'unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

utils.ts:1  BATTERY-STATE-CARD  2.1.1
button-card.js:425   BUTTON-CARD   Version 3.5.0 
fold-entity-row.js:86 FOLD-ENTITY-ROW 20.0.12 IS INSTALLED 
auto-entities.js:172 AUTO-ENTITIES 1.12.1 IS INSTALLED
formulaone-card.js:358  FORMULAONE-CARD  1.8.2
state-switch.js:139 STATE-SWITCH 1.9.5 IS INSTALLED 
multiple-entity-row.js:1  MULTIPLE-ENTITY-ROW  4.5.0 
swipe-navigation.js:1 ↔️ Swipe navigation ↔️ - v1.12.0
vertical-stack-in-card.js:1 vertical-stack-in-cardVersion: 0.4.4
mini-graph-card-bundle.js:1  MINI-GRAPH-CARD  0.11.0 
card-tools.js:90 CARD-TOOLS 2.1.2 IS INSTALLED  DeviceID: d3690002-47fee497
mushroom.js:3082 🍄 Mushroom 🍄 - 3.0.5

load_resource.ts:13 Uncaught (in promise) https://***redacted***/hacsfiles/lovelace-flower-card/flower-card.js
s.onerror @ load_resource.ts:13
error (async)
(anonymous) @ load_resource.ts:13
o @ load_resource.ts:6
n @ load_resource.ts:37
(anonymous) @ load-resources.ts:30
n @ load-resources.ts:12
(anonymous) @ ha-panel-lovelace.ts:235
Promise.then (async)
value @ ha-panel-lovelace.ts:233
value @ ha-panel-lovelace.ts:153
_$AE @ reactive-element.ts:1378
performUpdate @ reactive-element.ts:1345
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
u @ reactive-element.ts:948
_ @ reactive-element.ts:931
A @ lit-element.ts:115
o @ ha-panel-lovelace.ts:66
C @ scoped-custom-element-registry.js:385
t @ scoped-custom-element-registry.js:236
value @ hass-router-page.ts:296
value @ hass-router-page.ts:316
_currentLoadProm.d.then._currentLoadProm @ hass-router-page.ts:214
Promise.then (async)
value @ hass-router-page.ts:205
performUpdate @ reactive-element.ts:1331
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
set @ reactive-element.ts:726
value @ hass-router-page.ts:284
await in value (async)
value @ partial-panel-resolver.ts:227
value @ partial-panel-resolver.ts:88
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
u @ reactive-element.ts:948
_ @ reactive-element.ts:931
o @ hass-router-page.ts:48
r @ partial-panel-resolver.ts:44
C @ scoped-custom-element-registry.js:385
t @ scoped-custom-element-registry.js:236
u @ lit-html.ts:1129
g @ lit-html.ts:1543
_$AI @ lit-html.ts:1384
G @ lit-html.ts:2183
update @ lit-element.ts:165
performUpdate @ reactive-element.ts:1331
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
u @ reactive-element.ts:948
_ @ reactive-element.ts:931
A @ lit-element.ts:115
a @ home-assistant-main.ts:52
C @ scoped-custom-element-registry.js:385
t @ scoped-custom-element-registry.js:236
u @ lit-html.ts:1129
g @ lit-html.ts:1543
_$AI @ lit-html.ts:1384
G @ lit-html.ts:2183
update @ lit-element.ts:165
value @ home-assistant.ts:33
performUpdate @ reactive-element.ts:1331
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
set @ reactive-element.ts:726
value @ home-assistant.ts:207
await in value (async)
value @ home-assistant.ts:78
performUpdate @ reactive-element.ts:1329
scheduleUpdate @ reactive-element.ts:1263
_$Ej @ reactive-element.ts:1235
await in _$Ej (async)
requestUpdate @ reactive-element.ts:1210
set @ reactive-element.ts:726
value @ hass-base-mixin.ts:56
_updateHass @ context-mixin.ts:95
(anonymous) @ connection-mixin.ts:247
s @ store.js:19
(anonymous) @ collection.js:25
Promise.then (async)
d @ collection.js:25
l @ collection.js:27
(anonymous) @ collection.js:52
subscribe @ collection.js:96
E @ config.js:16
(anonymous) @ core.ts:119
Promise.then (async)
(anonymous) @ core.ts:114
(anonymous) @ core--xB4BlSVBjQ.js:1

plotly-graph-card.js:2224  PLOTLY-GRAPH  3.3.3 production

Running all latest versions:
Home Assistant: 2023.8.0
Flower card: 3.0.0
Home Assistant Plant custom: 2.2.0
OpenPlantBook: 1.2.0

Tried rebooting, reloading config, etc etc.

It was my own CSP (Content Security Policy) on Traefik blocking the Lit import. After adjusting the CSP, all is fine.

I had the same problem, thanks for pointing out what it was. Once I added unpkg.com to the CSP, it started to work again. I really wish this card wouldn't load external resources, though...