dermotduffy / frigate-hass-card

A Lovelace card for Frigate in Home Assistant
MIT License
555 stars 59 forks source link

`Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.` #1217

Closed felipecrs closed 1 month ago

felipecrs commented 1 year ago

Checklist:

Release with the issue:

5.2.0

Last working release (if known):

Probably the previous one was working

Browser and Operating System:

This error is in HA logs, so I'm not sure where this was originated from.

Description of problem:

Logger: frontend.js.latest.202307050
Source: components/system_log/__init__.py:257
First occurred: 16:26:37 (6 occurrences)
Last logged: 18:57:42

https://<ha>/frontend_latest/core-Bgg17Xv0dRA.js:1:8120 Uncaught Error: Suspend promise not set
https://<ha>/hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:2646 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.

Frigate card diagnostic information

{
  "ha_version": "2023.7.0",
  "card_version": "5.2.0",
  "browser": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36",
  "date": "2023-07-05T22:22:37.289Z",
  "frigate_version": {
    "624fd5a51dc304193d7e34ab79e1dae3": "4.0.0/0.12.1-367d724"
  },
  "lang": "pt_BR",
  "timezone": "America/Sao_Paulo",
  "git": {
    "build_version": "5.2.0-HEAD+g69249b6",
    "build_date": "Fri, 23 Jun 2023 15:26:26 GMT",
    "commit_date": "Thu, 22 Jun 2023 09:21:26 -0600"
  },
  "config": {
    "type": "custom:frigate-card",
    "card_id": "video_porteiro",
    "view": {
      "default": "live",
      "update_force": false
    },
    "automations": [
      {
        "conditions": {
          "fullscreen": false
        },
        "actions": [
          {
            "action": "custom:frigate-card-action",
            "frigate_card_action": "live_substream_off"
          }
        ]
      }
    ],
    "overrides": [
      {
        "conditions": {
          "fullscreen": true
        },
        "overrides": {
          "menu": {
            "style": "overlay",
            "buttons": {
              "substreams": {
                "enabled": true
              }
            }
          },
          "live": {
            "layout": {
              "fit": "contain",
              "position": {
                "x": 50,
                "y": 50
              }
            }
          }
        }
      }
    ],
    "cameras_global": {
      "live_provider": "go2rtc",
      "go2rtc": {
        "modes": [
          "webrtc"
        ]
      },
      "image": {
        "refresh_seconds": 1
      },
      "webrtc_card": {
        "muted": true,
        "ui": true,
        "mode": "webrtc",
        "style": "video {aspect-ratio: 16/9; object-fit: cover; object-position: left top;}\n.mode {display: none}\n.fullscreen {display: none}\n"
      }
    },
    "elements": [
      {
        "type": "custom:frigate-card-conditional",
        "conditions": {
          "view": [
            "live"
          ],
          "camera": [
            "camera.portao"
          ],
          "media_loaded": true
        },
        "elements": [
          {
            "type": "custom:frigate-card-menu-submenu-select",
            "entity": "select.camera_do_portao_night_vision",
            "alignment": "opposing",
            "priority": 52,
            "options": {
              "0": {
                "icon": "mdi:theme-light-dark"
              },
              "1": {
                "icon": "mdi:weather-sunny"
              },
              "2": {
                "icon": "mdi:weather-night"
              }
            }
          }
        ]
      },
      {
        "type": "custom:frigate-card-conditional",
        "conditions": {
          "view": [
            "live"
          ],
          "camera": [
            "camera.rua"
          ],
          "media_loaded": true
        },
        "elements": [
          {
            "type": "custom:frigate-card-menu-submenu-select",
            "entity": "select.camera_da_rua_night_vision",
            "alignment": "opposing",
            "priority": 52,
            "options": {
              "0": {
                "icon": "mdi:theme-light-dark"
              },
              "1": {
                "icon": "mdi:weather-sunny"
              },
              "2": {
                "icon": "mdi:weather-night"
              }
            }
          },
          {
            "type": "custom:frigate-card-ptz",
            "orientation": "vertical",
            "service": "onvif.ptz",
            "style": {
              "transform": "none",
              "right": "5%",
              "top": "45%"
            },
            "data_up": {
              "entity_id": "camera.rua_onvif",
              "tilt": "UP",
              "move_mode": "ContinuousMove",
              "speed": 0.05,
              "continuous_duration": 0.05
            },
            "data_down": {
              "entity_id": "camera.rua_onvif",
              "tilt": "DOWN",
              "move_mode": "ContinuousMove",
              "speed": 0.05,
              "continuous_duration": 0.05
            },
            "data_left": {
              "entity_id": "camera.rua_onvif",
              "pan": "LEFT",
              "move_mode": "ContinuousMove",
              "speed": 0.05,
              "continuous_duration": 0.05
            },
            "data_right": {
              "entity_id": "camera.rua_onvif",
              "pan": "RIGHT",
              "move_mode": "ContinuousMove",
              "speed": 0.05,
              "continuous_duration": 0.05
            }
          }
        ]
      }
    ],
    "menu": {
      "buttons": {
        "frigate": {
          "enabled": true
        },
        "snapshots": {
          "enabled": false
        },
        "image": {
          "enabled": false
        },
        "cameras": {
          "alignment": "opposing"
        },
        "timeline": {
          "enabled": false
        },
        "media_player": {
          "enabled": true
        },
        "clips": {
          "enabled": true
        },
        "camera_ui": {
          "enabled": true
        },
        "substreams": {
          "enabled": false,
          "alignment": "opposing",
          "priority": 51,
          "icon": "mdi:high-definition"
        },
        "expand": {
          "enabled": false
        },
        "microphone": {
          "enabled": false
        },
        "play": {
          "enabled": false
        },
        "mute": {
          "enabled": true
        }
      },
      "style": "outside",
      "position": "top",
      "alignment": "left"
    },
    "live": {
      "preload": false,
      "controls": {
        "next_previous": {
          "style": "none"
        },
        "title": {
          "mode": "none"
        },
        "thumbnails": {
          "mode": "none"
        },
        "builtin": false
      },
      "lazy_load": true,
      "lazy_unload": "all",
      "show_image_during_load": true,
      "layout": {
        "fit": "cover",
        "position": {
          "x": 0,
          "y": 0
        }
      },
      "microphone": {
        "disconnect_seconds": 60
      }
    },
    "dimensions": {
      "aspect_ratio_mode": "static",
      "aspect_ratio": "16:9"
    },
    "cameras": [
      {
        "camera_entity": "camera.video_porteiro",
        "webrtc_card": {
          "url": "video_porteiro"
        },
        "dependencies": {
          "cameras": [
            "video_porteiro_hd"
          ]
        },
        "go2rtc": {
          "modes": [
            "webrtc"
          ]
        }
      },
      {
        "camera_entity": "camera.rua",
        "webrtc_card": {
          "url": "rua"
        },
        "dependencies": {
          "cameras": [
            "rua_hd"
          ]
        }
      },
      {
        "camera_entity": "camera.morro",
        "webrtc_card": {
          "url": "morro"
        },
        "dependencies": {
          "cameras": [
            "morro_hd"
          ]
        }
      },
      {
        "camera_entity": "camera.portao",
        "webrtc_card": {
          "url": "portao"
        },
        "dependencies": {
          "cameras": [
            "portao_hd"
          ]
        }
      },
      {
        "camera_entity": "camera.video_porteiro",
        "title": "Vídeo Porteiro (HD)",
        "id": "video_porteiro_hd",
        "webrtc_card": {
          "url": "video_porteiro_hd"
        },
        "hide": true,
        "go2rtc": {
          "stream": "video_porteiro_hd"
        }
      },
      {
        "camera_entity": "camera.rua",
        "title": "Rua (HD)",
        "id": "rua_hd",
        "webrtc_card": {
          "url": "rua_hd"
        },
        "hide": true,
        "go2rtc": {
          "stream": "rua_hd"
        }
      },
      {
        "camera_entity": "camera.morro",
        "title": "Morro (HD)",
        "id": "morro_hd",
        "webrtc_card": {
          "url": "morro_hd"
        },
        "hide": true,
        "go2rtc": {
          "stream": "morro_hd"
        }
      },
      {
        "camera_entity": "camera.portao",
        "title": "Portão (HD)",
        "id": "portao_hd",
        "webrtc_card": {
          "url": "portao_hd"
        },
        "hide": true,
        "go2rtc": {
          "stream": "portao_hd"
        }
      }
    ],
    "image": {
      "mode": "camera"
    },
    "performance": {
      "profile": "low"
    },
    "media_viewer": {
      "auto_play": "all",
      "auto_unmute": "all"
    }
  }
}

Javascript errors shown in the web inspector (if applicable):

None.

Additional information:

I'm just wondering if this is something to be fixed here.

dermotduffy commented 1 year ago

Thanks. This is from an underlying library that the card uses, will investigate if there's anything that can be done at this end.

If you happen to know what you did to generate that, let me know as it's not in my logs :-(

glbailey commented 1 year ago

Same "uncaught type error" here for some time now, even with latest 2023.7.01 update. Also comes with "not an object" error. Hope that helps...

.../hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:2646 Uncaught TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
.../hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:2646 TypeError: Window.getComputedStyle: Argument 1 is not an object.
felipecrs commented 1 year ago

If you happen to know what you did to generate that, let me know as it's not in my logs :-(

I still wasn't able to figure out what triggered it, but I'll let you know if I discover.

glbailey commented 1 year ago

Thanks. I just don’t know how to drill down to get you more information. But the errors continue to happen.

On Jul 11, 2023, at 9:37 AM, Felipe Santos @.***> wrote:

If you happen to know what you did to generate that, let me know as it's not in my logs :-(

I still wasn't able to figure out what triggered it, but I'll let you know if I discover.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

felipecrs commented 1 year ago

I did not observe this issue in my logs recently. Note that I am still using Frigate Card v5.2.0. Is anyone else still observing this issue?

glbailey commented 1 year ago

On Frigate card 5.2.0 with OS 10.5 and Core 2023.10.1 and errors seems to have gone away!

On Oct 15, 2023, at 10:13 AM, Felipe Santos @.***> wrote:

I did not observe this issue in my logs recently. Note that I am still using Frigate Card v5.2.0. Is anyone else still observing this issue?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>

glbailey commented 9 months ago

I spoke too soon. 43 occurances over last 24 hrs. Not sure I understand the error message though. I am using Firefox/Mac but it mentions Chrome, Android 9. Where can I look to get more info? [core 2024.1.3, Supervisor 2023.12.1, OS 11.4]

Uncaught error from Firefox 122.0 on Mac OS 10.15 TypeError: Window.getComputedStyle: Argument 1 is not an object. C (/hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:2646) S (/hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:5376) A (/hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:6745) L/< (/hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:7794) Uncaught error from Chrome WebView 114.0.5735.220 on Android 9 TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'. C (/hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:2646) S (/hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:5375) A (/hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:6744) /hacsfiles/frigate-hass-card/zoomer-1857311a.js:1:7793 Uncaught error from Firefox 122.0 on Mac OS 10.15 TypeError: e.detail.value is undefined _serviceDataChanged (src/panels/developer-tools/service/developer-tools-service.ts:495:39) _yamlChanged (src/panels/developer-tools/service/developer-tools-service.ts:462:9) call (src/lit-html.ts:2018:28) dispatchEvent (src/common/dom/fire_event.ts:76:7) load (src/components/ha-yaml-editor.ts:135:14) call (src/lit-html.ts:2018:28) dispatchEvent (src/common/dom/fire_event.ts:76:7) Number (src/components/ha-code-editor.ts:299:14) update (node_modules/@codemirror/view/dist/index.js:7065:29) update (node_modules/@codemirror/view/dist/index.js:6949:27)

dermotduffy commented 6 months ago

FYI: I ~accidentally managed to reproduce this while playing around, it seems to happen when the underlying zoom library that the card uses is passed an element that has been removed from the DOM. That in itself shouldn't actually happen, and with the dev branch at least I can't get it to, but updating this bug as a reminder to myself about what causes the message if people keep having this issue after the next release.

felipecrs commented 5 months ago

I observed this error again today in my HA logs:

2024-05-24 12:26:06.548 ERROR (MainThread) [frontend.js.latest.202405011] Uncaught error from Chrome WebView 124.0.6367.179 on Android 14
TypeError: Failed to execute 'getComputedStyle' on 'Window': parameter 1 is not of type 'Element'.
C (/local/custom/frigate-hass-card/zoomer-345c3866.js:1:2646)
S (/local/custom/frigate-hass-card/zoomer-345c3866.js:1:5375)
A (/local/custom/frigate-hass-card/zoomer-345c3866.js:1:6744)
/local/custom/frigate-hass-card/zoomer-345c3866.js:1:7793

I am using 305a2db573d16bb7a91da65e7792b116b12a33b8 atm (dev but not latest dev).

I don't think it's big deal though. But I wonder if it has any relationship with when my card super rarely doesn't load in my kitchen's tablet. I will try looking at the logs if I notice it again.

dermotduffy commented 1 month ago

[Issue cleanup] If you still have issues with this, please try the latest release (https://github.com/dermotduffy/frigate-hass-card/releases/tag/v6.0.0-beta.4) first and re-open this. Thanks and good luck!

felipecrs commented 1 month ago

I have not noticed this issue recently. Indeed I think it has been fixed.