Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I get "r.setConfig is not a function after refreshing" page. #206

Open
1 task done
el97 opened this issue May 14, 2023 · 7 comments
Open
1 task done

I get "r.setConfig is not a function after refreshing" page. #206

el97 opened this issue May 14, 2023 · 7 comments
Labels
bug Something isn't working

Comments

@el97
Copy link

el97 commented May 14, 2023

Bug report notice

Before you file a bug, make sure that you did not make a configuration mistake. The Swiss Army Knife in its current state does not yet have full configuration sanity checks!

So make sure your problem is not related to that!

  • Yes, I'm sure that it is not a configuration mistake

Bug description

I'm getting the error r.setConfig is not a function every time I reload the dashboard. If I clear the cache the cards come back but when I refresh normally the error shows up.

To Reproduce

Steps to reproduce the behavior:

  1. Clear the cache and go to the dashboard where you have the card.
  2. Refresh the page normally and the error shows up.

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

If applicable, add screenshots to help explain your problem.

Desktop browser (please complete the following information):

  • OS: [Windows]
  • Browser [Firefox]
  • Version [Latest]

Companion App on Smartphone/Tablet (please complete the following information):

  • Device: [e.g. iPhone16]
  • OS: [e.g. iOS16]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 16]

Additional context
Here is some logs that I found in my browser

01:16:13,030   SWISS-ARMY-KNIFE-CARD  
      Version 2.4.2      [swiss-army-knife-card.js:677:18](https://lots.duckdns.org/hacsfiles/swiss-army-knife-card/swiss-army-knife-card.js?hacstag=214786112242)
01:16:13,031
SAK - System Templates reference NOT defined. [swiss-army-knife-card.js:898:1489](https://lots.duckdns.org/hacsfiles/swiss-army-knife-card/swiss-army-knife-card.js?hacstag=214786112242)
    get styles swiss-army-knife-card.js:898
    getStyles swiss-army-knife-card.js:159
    _getUniqueStyles swiss-army-knife-card.js:159
    initialize swiss-army-knife-card.js:159
    K swiss-army-knife-card.js:134
    at swiss-army-knife-card.js:159
    xe swiss-army-knife-card.js:677
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    a create-element-base.ts:93
    u create-element-base.ts:111
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    value hui-stack-card.ts:121
    value hui-stack-card.ts:110
    n fire_event.ts:76
    u create-element-base.ts:129
    (Async: promise callback)
    u create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    u create-element-base.ts:149
    (Async: promise callback)
    u create-element-base.ts:145
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    r hui-view.ts:43
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    value hui-root.ts:926
    value hui-root.ts:670
    (Async: setTimeout handler)
    n render-status.ts:2
    (Async: FrameRequestCallback)
    n render-status.ts:2
    value hui-root.ts:670
    _$AE reactive-element.ts:1380
    performUpdate reactive-element.ts:1345
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    k lit-element.ts:115
    P hui-root.ts:99
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    u lit-html.ts:1121
    g lit-html.ts:1528
    _$AI lit-html.ts:1372
    $ lit-html.ts:2168
    update lit-element.ts:165
    performUpdate reactive-element.ts:1331
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    set reactive-element.ts:726
    value ha-panel-lovelace.ts:292
    value ha-panel-lovelace.ts:153
    _$AE reactive-element.ts:1378
01:16:13,032
SAK - System Templates reference NOT defined. [swiss-army-knife-card.js:898:1489](https://lots.duckdns.org/hacsfiles/swiss-army-knife-card/swiss-army-knife-card.js?hacstag=214786112242)
    get styles swiss-army-knife-card.js:898
    getStyles swiss-army-knife-card.js:159
    _getUniqueStyles swiss-army-knife-card.js:159
    initialize swiss-army-knife-card.js:159
    K swiss-army-knife-card.js:134
    at swiss-army-knife-card.js:159
    xe swiss-army-knife-card.js:677
    E scoped-custom-element-registry.js:388
    t scoped-custom-element-registry.js:236
    a create-element-base.ts:93
    u create-element-base.ts:111
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    value hui-stack-card.ts:121
    value hui-stack-card.ts:110
    n fire_event.ts:76
    u create-element-base.ts:129
    (Async: promise callback)
    u create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    u create-element-base.ts:149
    (Async: promise callback)
    u create-element-base.ts:145
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    r hui-view.ts:43
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    value hui-root.ts:926
    value hui-root.ts:670
    (Async: setTimeout handler)
    n render-status.ts:2
    (Async: FrameRequestCallback)
    n render-status.ts:2
    value hui-root.ts:670
    _$AE reactive-element.ts:1380
    performUpdate reactive-element.ts:1345
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    k lit-element.ts:115
    P hui-root.ts:99
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    u lit-html.ts:1121
    g lit-html.ts:1528
    _$AI lit-html.ts:1372
    $ lit-html.ts:2168
    update lit-element.ts:165
    performUpdate reactive-element.ts:1331
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    set reactive-element.ts:726
    value ha-panel-lovelace.ts:292
    value ha-panel-lovelace.ts:153
    _$AE reactive-element.ts:1378
01:16:13,033
Uncaught Error: card::get styles - System Templates reference NOT defined!
    get styles swiss-army-knife-card.js:898
    getStyles swiss-army-knife-card.js:159
    _getUniqueStyles swiss-army-knife-card.js:159
    initialize swiss-army-knife-card.js:159
    K swiss-army-knife-card.js:134
    at swiss-army-knife-card.js:159
    xe swiss-army-knife-card.js:677
    E scoped-custom-element-registry.js:388
    t scoped-custom-element-registry.js:236
    a create-element-base.ts:93
    u create-element-base.ts:111
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    value hui-stack-card.ts:121
    value hui-stack-card.ts:110
    n fire_event.ts:76
    u create-element-base.ts:129
    promise callback*7778/u/< create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    u create-element-base.ts:149
    promise callback*7778/u/< create-element-base.ts:145
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    r hui-view.ts:43
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    value hui-root.ts:926
    value hui-root.ts:670
    setTimeout handler*n/< render-status.ts:2
    n render-status.ts:2
    value hui-root.ts:670
    _$AE reactive-element.ts:1380
    performUpdate reactive-element.ts:1345
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    k lit-element.ts:115
    P hui-root.ts:99
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    u lit-html.ts:1121
    g lit-html.ts:1528
    _$AI lit-html.ts:1372
    $ lit-html.ts:2168
    update lit-element.ts:165
    performUpdate reactive-element.ts:1331
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    set reactive-element.ts:726
    value ha-panel-lovelace.ts:292
    value ha-panel-lovelace.ts:153
    _$AE reactive-element.ts:1378
[swiss-army-knife-card.js:898:1544](https://lots.duckdns.org/hacsfiles/swiss-army-knife-card/swiss-army-knife-card.js?hacstag=214786112242)
01:16:13,033
card custom:swiss-army-knife-card TypeError: r.setConfig is not a function
    a create-element-base.ts:97
    u create-element-base.ts:111
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    value hui-stack-card.ts:121
    value hui-stack-card.ts:110
    n fire_event.ts:76
    u create-element-base.ts:129
    promise callback*7778/u/< create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    u create-element-base.ts:149
    promise callback*7778/u/< create-element-base.ts:145
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    r hui-view.ts:43
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    value hui-root.ts:926
    value hui-root.ts:670
    setTimeout handler*n/< render-status.ts:2
    n render-status.ts:2
    value hui-root.ts:670
    _$AE reactive-element.ts:1380
    performUpdate reactive-element.ts:1345
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    k lit-element.ts:115
    P hui-root.ts:99
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    u lit-html.ts:1121
    g lit-html.ts:1528
    _$AI lit-html.ts:1372
    $ lit-html.ts:2168
    update lit-element.ts:165
    performUpdate reactive-element.ts:1331
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    set reactive-element.ts:726
    value ha-panel-lovelace.ts:292
    value ha-panel-lovelace.ts:153
    _$AE reactive-element.ts:1378
[create-element-base.ts:182:12](https://raw.githubusercontent.com/home-assistant/frontend/20230503.3/src/panels/lovelace/create-element/create-element-base.ts)
01:16:13,034
SAK - System Templates reference NOT defined. [swiss-army-knife-card.js:898:1489](https://lots.duckdns.org/hacsfiles/swiss-army-knife-card/swiss-army-knife-card.js?hacstag=214786112242)
    get styles swiss-army-knife-card.js:898
    getStyles swiss-army-knife-card.js:159
    _getUniqueStyles swiss-army-knife-card.js:159
    initialize swiss-army-knife-card.js:159
    K swiss-army-knife-card.js:134
    at swiss-army-knife-card.js:159
    xe swiss-army-knife-card.js:677
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    a create-element-base.ts:93
    u create-element-base.ts:111
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    value hui-stack-card.ts:121
    value hui-stack-card.ts:110
    n fire_event.ts:76
    u create-element-base.ts:129
    (Async: promise callback)
    u create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    r hui-view.ts:43
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    value hui-root.ts:926
    _debouncedConfigChanged hui-root.ts:103
    n debounce.ts:18
    (Async: setTimeout handler)
    i debounce.ts:23
    handleEvent lit-html.ts:2003
    n fire_event.ts:76
    u create-element-base.ts:129
    (Async: promise callback)
    u create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
01:16:13,035
SAK - System Templates reference NOT defined. [swiss-army-knife-card.js:898:1489](https://lots.duckdns.org/hacsfiles/swiss-army-knife-card/swiss-army-knife-card.js?hacstag=214786112242)
    get styles swiss-army-knife-card.js:898
    getStyles swiss-army-knife-card.js:159
    _getUniqueStyles swiss-army-knife-card.js:159
    initialize swiss-army-knife-card.js:159
    K swiss-army-knife-card.js:134
    at swiss-army-knife-card.js:159
    xe swiss-army-knife-card.js:677
    E scoped-custom-element-registry.js:388
    t scoped-custom-element-registry.js:236
    a create-element-base.ts:93
    u create-element-base.ts:111
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    value hui-stack-card.ts:121
    value hui-stack-card.ts:110
    n fire_event.ts:76
    u create-element-base.ts:129
    (Async: promise callback)
    u create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    r hui-view.ts:43
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    value hui-root.ts:926
    _debouncedConfigChanged hui-root.ts:103
    n debounce.ts:18
    (Async: setTimeout handler)
    i debounce.ts:23
    handleEvent lit-html.ts:2003
    n fire_event.ts:76
    u create-element-base.ts:129
    (Async: promise callback)
    u create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
01:16:13,035
Uncaught Error: card::get styles - System Templates reference NOT defined!
    get styles swiss-army-knife-card.js:898
    getStyles swiss-army-knife-card.js:159
    _getUniqueStyles swiss-army-knife-card.js:159
    initialize swiss-army-knife-card.js:159
    K swiss-army-knife-card.js:134
    at swiss-army-knife-card.js:159
    xe swiss-army-knife-card.js:677
    E scoped-custom-element-registry.js:388
    t scoped-custom-element-registry.js:236
    a create-element-base.ts:93
    u create-element-base.ts:111
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    value hui-stack-card.ts:121
    value hui-stack-card.ts:110
    n fire_event.ts:76
    u create-element-base.ts:129
    promise callback*7778/u/< create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    r hui-view.ts:43
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    value hui-root.ts:926
    _debouncedConfigChanged hui-root.ts:103
    n debounce.ts:18
    setTimeout handler*i debounce.ts:23
    handleEvent lit-html.ts:2003
    n fire_event.ts:76
    u create-element-base.ts:129
    promise callback*7778/u/< create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
[swiss-army-knife-card.js:898:1544](https://lots.duckdns.org/hacsfiles/swiss-army-knife-card/swiss-army-knife-card.js?hacstag=214786112242)
01:16:13,035
card custom:swiss-army-knife-card TypeError: r.setConfig is not a function
    a create-element-base.ts:97
    u create-element-base.ts:111
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    value hui-stack-card.ts:121
    value hui-stack-card.ts:110
    n fire_event.ts:76
    u create-element-base.ts:129
    promise callback*7778/u/< create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-stack-card.ts:102
    _cards hui-stack-card.ts:47
    value hui-stack-card.ts:46
    a create-element-base.ts:97
    u create-element-base.ts:140
    u create-element-base.ts:238
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
    r hui-view.ts:43
    E scoped-custom-element-registry.js:385
    t scoped-custom-element-registry.js:236
    value hui-root.ts:926
    _debouncedConfigChanged hui-root.ts:103
    n debounce.ts:18
    setTimeout handler*i debounce.ts:23
    handleEvent lit-html.ts:2003
    n fire_event.ts:76
    u create-element-base.ts:129
    promise callback*7778/u/< create-element-base.ts:127
    u create-element-base.ts:215
    d create-element-base.ts:172
    w create-card-element.ts:99
    value hui-view.ts:64
    _cards hui-view.ts:283
    value hui-view.ts:282
    value hui-view.ts:216
    value hui-view.ts:130
    performUpdate reactive-element.ts:1329
    scheduleUpdate reactive-element.ts:1263
    _$Ej reactive-element.ts:1235
    requestUpdate reactive-element.ts:1210
    u reactive-element.ts:948
    g reactive-element.ts:931
@el97 el97 added the bug Something isn't working label May 14, 2023
@github-actions
Copy link

Thank you for creating your first issue for the Swiss Army Knife custom card!

@AmoebeLabs
Copy link
Owner

First question: which version of SAK are you running?

Furthermore, the errors point to SAK being unable to find the system templates.

    if (!SwissArmyKnifeCard.lovelace.config.sak_sys_templates) {
      console.error('SAK - System Templates reference NOT defined.');
      throw Error('card::get styles - System Templates reference NOT defined!');
    }
    if (!SwissArmyKnifeCard.lovelace.config.sak_user_templates) {
      console.warning('SAK - User Templates reference NOT defined. Did you NOT include them?');

These templates should be included in your dashboard.yaml files:

For example, ui-lovelacy.yaml

# Include custom cards / tools and plugins for lovelace.
#
# resources:
# 
  
# Decluttering Templates
decluttering_templates:
  !include lovelace/decluttering_templates/decluttering_templates.yaml

# Swiss Army Knife Templates
#
# The system templates come with the HACS install and can be updated
# with a new release. That part is automatic!
sak_sys_templates:
  !include www/community/swiss-army-knife-card/sak_templates.yaml

# The user templates are created by the user, and won't be updated 
# with a new release. If changes are required, then the user has to
# update the template configuration files.
sak_user_templates:
  !include lovelace/sak_templates/sak_templates.yaml

If you use more dashboards, then each dashboard should include these templates...

@el97
Copy link
Author

el97 commented May 21, 2023

I apologize for the late reply. I'm using the latest version which is 2.4.5. It looks like I have misunderstood something in the installation process. Does it need to be a dashboard that is configured using yaml? Right now I'm trying with a UI dashboard and adding the needed resources that way. Could this be the issue?

@martydingo
Copy link

I also get this, mostly on mobile clients. A refresh (not hard refresh) usually fixes it.

@AmoebeLabs
Copy link
Owner

AmoebeLabs commented Jun 4, 2023

It seems there is some timing or alphabetical order issue how Lovelace loads resources needed for SAK.

I experimented with changing folder names, and then some of these loading issues completely disappeared.

For instance alayout template was unable to load a swatch (s > l) template. When I changed the folder to cswatch (c < l), loading was fine…

I should ask the HA devs if they can explain this behavior as maybe this can be fixed.

@el97
Copy link
Author

el97 commented Jun 6, 2023

It seems there is some timing or alphabetical order issue how Lovelace loads resources needed for SAK.

I experimented with changing folder names, and then some of these loading issues completely disappeared.

For instance alayout template was unable to load a swatch (s > l) template. When I changed the folder to cswatch (c < l), loading was fine…

I should ask the HA devs if they can explain this behavior as maybe this can be fixed.

So the issue is not on my end? Just want to be sure since I have scratched my head for a while now.

@AmoebeLabs
Copy link
Owner

It seems there is some timing or alphabetical order issue how Lovelace loads resources needed for SAK.
I experimented with changing folder names, and then some of these loading issues completely disappeared.
For instance alayout template was unable to load a swatch (s > l) template. When I changed the folder to cswatch (c < l), loading was fine…
I should ask the HA devs if they can explain this behavior as maybe this can be fixed.

So the issue is not on my end? Just want to be sure since I have scratched my head for a while now.

You should see my forehead and my desk 😄

It was pure coincidence that I found what looks like an ordering and/or chunking problem.
While I was creating swatches, I got a lot of "Template not found" errors on my desktop. And after hitting F5 the template "suddenly" was found.

And then I decided that the "swatches" folder should be named "color-swatches" or "cswatches". And then suddenly the errors disappeared 😮

So, if you can do the following experiment, we know more.

You must have the following folder in your config:

image

Now try the following to find out if alphabetic order is the problem:

  • rename the folders, and only the folders to the following to force ordering:
    • colorstops to a-colorstops
    • swatches (if you have that folder) to b-swatches
    • derived to c-derived
    • toolsets to d-toolsets
    • layouts to z-layouts

See if that helps. Don't forget to clear all caches on mobile and desktop browser, and possibly restart Home Assistant to make sure the new structure is loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants