thomasloven / hass-lovelace_gen

🔹 Improve the lovelace yaml parser for Home Assistant
MIT License
209 stars 22 forks source link

Errors when rendoring templated ui-lovelace #7

Closed johntdyer closed 4 years ago

johntdyer commented 4 years ago

When I refresh the page I get the following error in my logs

2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/lovelace-gui-sandbox/gui-sandbox.js?1574795612.0075958:1:0 NotSupportedError: 'gui-sandbox' has already been defined as a custom element
2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/ha-card-waze-travel-time/ha-card-waze-travel-time.js?1574795612.0076425:86:0 NotSupportedError: 'ha-card-waze-travel-time' has already been defined as a custom element
2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/gauge-card/gauge-card.js?1574795612.0076673:200:0 NotSupportedError: 'gauge-card' has already been defined as a custom element
2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/rgb-light-card/card.js?1574795612.0076885:1:1 SyntaxError: redeclaration of let RGBLightCard
2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/synthwave-hass-extras/synthwave-hass-extras.js?1574795612.0077326:1:1 SyntaxError: redeclaration of let hacsInterval
2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/flex-horseshoe-card/flex-horseshoe-card.js?1574795612.0077531:1938:0 NotSupportedError: 'flex-horseshoe-card' has already been defined as a custom element
2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/zigbee2mqtt-networkmap/zigbee2mqtt-networkmap.js?1574795612.0077116:7:0 NotSupportedError: 'zigbee2mqtt-networkmap' has already been defined as a custom element
2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/bignumber-card/bignumber-card.js?1574795612.0079293:107:0 NotSupportedError: 'bignumber-card' has already been defined as a custom element
2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/username-element/username-element.js?1574795612.0080316:6:0 NotSupportedError: 'username-element' has already been defined as a custom element
2019-11-26 14:13:36 ERROR (MainThread) [frontend.js.latest.201911196] https://xxxxxx.com/community_plugin/fan-control-entity-row/fan-control-entity-row.js?1574795612.0078158:1:1 SyntaxError: redeclaration of let CustomFanRow

my config is as follows:

# lovelace_gen

resources:
  - url: !file /community_plugin/lovelace-gui-sandbox/gui-sandbox.js
    type: module

  - url: !file /community_plugin/ha-card-waze-travel-time/ha-card-waze-travel-time.js
    type: module

  - url: !file /community_plugin/gauge-card/gauge-card.js
    type: module

  - url: !file /community_plugin/rgb-light-card/card.js
    type: js

  - url: !file /community_plugin/zigbee2mqtt-networkmap/zigbee2mqtt-networkmap.js
    type: module

  # # https://github.com/custom-cards/config-template-card

  - url: !file /community_plugin/synthwave-hass-extras/synthwave-hass-extras.js
    type: js

  - url: !file /community_plugin/flex-horseshoe-card/flex-horseshoe-card.js
    type: module

  - url: !file /community_plugin/unused-card/unused-card.js
    type: module

  - url: !file /community_plugin/config-template-card/config-template-card.js
    type: module

  - url: !file /community_plugin/fan-control-entity-row/fan-control-entity-row.js
    type: js

  - url: !file /community_plugin/lovelace-popup-card/popup-card.js
    type: js

  - url: !file /community_plugin/dual-thermostat/dual-thermostat.js
    type: js

  - url: !file /community_plugin/dual-gauge-card/dual-gauge-card.js
    type: js

  - url: !file /community_plugin/mini-graph-card/mini-graph-card.js
    type: module

  - url: !file /community_plugin/entity-attributes-card/entity-attributes-card.js
    type: module

  - url: !file /community_plugin/bignumber-card/bignumber-card.js
    type: module

  - url: !file /community_plugin/roku-card/roku-card.js
    type: module

  - url: !file /community_plugin/secondaryinfo-entity-row/secondaryinfo-entity-row.js
    type: module

  - url: !file /community_plugin/button-entity-row/button-entity-row.js
    type: module

  - url: !file /community_plugin/upcoming-media-card/upcoming-media-card.js
    type: module

  - url: !file /community_plugin/username-element/username-element.js
    type: module

  - url: !file /community_plugin/ext-weblink/ext-weblink.js
    type: module

  - url: !file /community_plugin/state-element/state-element.js
    type: module

  - url: !file /community_plugin/vertical-stack-in-card/vertical-stack-in-card.js
    type: module

  - url: !file /community_plugin/travel-time-card/travel-time-card.js
    type: js

  - url: !file /community_plugin/circle-sensor-card/circle-sensor-card.js
    type: module

  - url: !file /community_plugin/group-card/group-card.js
    type: module

  # - url: !file /community_plugin/monster-card/monster-card.js
  #   type: module

  - url: !file /community_plugin/text-divider-row/text-divider-row.js
    type: module

  - url: !file /community_plugin/compact-custom-header/compact-custom-header.js
    type: module

  - url: !file /community_plugin/surveillance-card/surveillance-card.js
    type: module

  - url: !file /community_plugin/button-card/button-card.js
    type: module

  - url: !file /community_plugin/mini-media-player/mini-media-player.js
    type: module

  - url: !file /community_plugin/list-card/list-card.js
    type: js

  - url: !file /community_plugin/lovelace-auto-entities/auto-entities.js
    type: js

  - url: !file /community_plugin/bar-card/bar-card.js
    type: js

  - url: !file /community_plugin/simple-weather-card/simple-weather-card-bundle.js
    type: module

  - url: !file /community_plugin/lovelace-card-tools/card-tools.js
    type: js

  - url: !file /community_plugin/banner-card/banner-card.js
    type: module

  - url: !file /community_plugin/lovelace-card-modder/card-modder.js
    type: js

  - url: !file /community_plugin/lovelace-fold-entity-row/fold-entity-row.js
    type: js

  - url: !file /community_plugin/lovelace-layout-card/layout-card.js
    type: js

  - url: !file /community_plugin/lovelace-gap-card/gap-card.js
    type: js

  - url: !file /community_plugin/lovelace-state-switch/state-switch.js
    type: js

  - url: !file /community_plugin/spotify-card/spotify-card.js
    type: module

  - url: !file /community_plugin/air-visual-card/air-visual-card.js
    type: js

  - url: /local/custom-weather-card-chart.js
    type: module

  - url: !file /community_plugin/logbook-card/logbook-card.js
    type: js

cch:
  background: 'rgba(150, 150, 150, 0.2)'
  menu: show
  options: show
  voice: show
  notifications: clock
  clock_format: '24'
  clock_date: true
  date_locale: en-us
  disable: false

button_card_templates:
  - !include lovelace/templates.yaml

title: Home
views:

  # Main
  - !include
      - lovelace/lovelace-main-view.yaml
      - title: Main
      - path: home
      - icon: "mdi:home-assistant"
      - panel: false
      - cards:

  # Upstairs
  - !include
      - lovelace/lovelace-upstairs-view.yaml
      - title: Upstairs
      - path: upstairs
      - icon: "mdi:human-child"
      - panel: false
      - cards:

  # Garage

and idea what I may be doing wrong here ?

thomasloven commented 4 years ago

That's because when you do a refresh, every URL updates, so your browser will try to load the resources again. Since they are already loaded once, you'll unfortunately get those errors.

A hard refresh will fix it, but the errors can be safely ignored.