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

Cannot read properties issue since 2023.4.x #67

Open
2 tasks done
SupremeSports opened this issue Apr 16, 2023 · 9 comments
Open
2 tasks done

Cannot read properties issue since 2023.4.x #67

SupremeSports opened this issue Apr 16, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@SupremeSports
Copy link

SupremeSports commented Apr 16, 2023

Checklist:

  • I updated to the latest version available
  • I cleared the cache of my browser

Release with the issue:
v1.0.0
Last working release (if known):

Browser and Operating System:
Chrome on Win10, HA App on iOS

Description of problem:
Unable to use standard HACS ressource reference, have to manually enter it.
Problem occurs since 2023.4.x (went from 2023.3.6 to 2023.4.4 and got the issue). Tested on 2 different HA systems and same thing happens.

Error message on each declut card: Cannot read properties of null (reading'config')
Error message

Into resource.yaml:
Normal reference:

  - url: /hacsfiles/decluttering-card/decluttering-card.js
    type: module

Modified reference:

  - url: /local/community/decluttering-card/decluttering-card.js
    type: module
@SupremeSports SupremeSports added the bug Something isn't working label Apr 16, 2023
@SupremeSports SupremeSports changed the title Cannot read properties Issue since 2023.4.x Cannot read properties issue since 2023.4.x Apr 16, 2023
@electricJP
Copy link

electricJP commented Apr 21, 2023

I have the same issue but I already use the modified reference

lovelace:
mode: yaml
resources:
- url: /hacsfiles/lovelace-hui-element/hui-element.js
type: module
- url: /local/community/decluttering-card/decluttering-card.js
type: module
- url: /local/community/button-card/button-card.js
type: module
- url: /local/community/apexcharts-card/apexcharts-card.js
type: module
- url: /local/community/bar-card/bar-card.js
type: module

@brainpt
Copy link

brainpt commented Apr 24, 2023

I have the same issue but I already use the modified reference

lovelace: mode: yaml resources: - url: /hacsfiles/lovelace-hui-element/hui-element.js type: module - url: /local/community/decluttering-card/decluttering-card.js type: module - url: /local/community/button-card/button-card.js type: module - url: /local/community/apexcharts-card/apexcharts-card.js type: module - url: /local/community/bar-card/bar-card.js type: module

I'm also facing the same issue, running the latest decluttering version (and already had the modified reference) and with HA 2023.4.6 version.

Cannont read properties of null (reading 'config')

@rcdailey
Copy link

I'm having this issue as well. What do you guys mean by "modified reference"? Is that referring to the /hacsfiles URL paths in the resources.yaml file?

@luixal
Copy link

luixal commented Apr 26, 2023

Same problem on a fresh install using HACS.

@brainpt
Copy link

brainpt commented Apr 26, 2023

I'm having this issue as well. What do you guys mean by "modified reference"? Is that referring to the /hacsfiles URL paths in the resources.yaml file?

Yes. That's it.

@rcdailey
Copy link

Can you point me to where that change is documented? I haven't touched my URL paths in a LONG time and I'm unaware of any deprecations or the like.

@RandyLevensalor
Copy link

I ended up uninstalling decluttering-card from HACS, then reinstalling it.

I changed the resource import from:

    - url: /local/community/decluttering-card/decluttering-card.js
      type: module

to:

    - url: /hacsfiles/decluttering-card/decluttering-card.js
      type: module

It's now working. I'm not entirely sure why. I had tried the hacsfiles url before reinstalling and didn't work. This last update up home assistant had all kinds of issess, many of which required extra restarts.

@Nerkyator
Copy link

I have same problem. Changing resource import doesn't fix :(

HA version: 2023.10.1
Decluttering card version: last
Installation method: HACS
Dashboard: storage
Decluttering card added in resources through "three dots method" from UI

Just created decluttering_templates.yaml file with

decluttering_templates:
  cameras:
    card:
      camera_view: live
      type: picture-glance
      title: "[[title]]"
      entities: []
      camera_image: "[[camera]]"
      theme: Mushroom Shadow
      view_layout:
        grid-area: "[[gridArea]]"

Dashboard page yaml file:

decluttering_templates: !include ../common/decluttering_templates.yaml

type: custom:layout-card
layout_type: custom:grid-layout
view_layout:
  grid-area: content
layout:
  margin: 0px 0px 0px 0px
  card_margin: 0px 0px 0px 0px
  grid-template-columns: auto
  grid-template-rows: auto
  grid-template-areas: |
    "road terrace"
    "porch ."
cards:
  - type: custom:decluttering-card
    template: cameras
    variables:
      - title: Road
      - camera: camera.g4_dome_high
      - gridArea: road

Opening dashboard I have the well known error:

Cannot read properties of undefined (reading 'cameras')
type: custom:decluttering-card
template: cameras
variables:
  - title: Road
  - camera: camera.g4_dome_high
  - gridArea: road

@danielbrunt57
Copy link

I've just implemented this card for the first time and I had zero issues, once I wrapped my head around how it works.

Installed card via HACS.
image

Verified resource added.
image

Added decluttering template to lovelace dashboard via raw config editor.
image

Edited my existing 6 cards to use the decluttering card.

type: vertical-stack
cards:
  - type: custom:mushroom-title-card
    title: ''
    subtitle: Kitchen
    alignment: center
  - type: horizontal-stack
    cards:
      - type: custom:decluttering-card
        template: iblinds
        variables:
          - blind: kitchen_blind_1
          - display_name: Blind 1
      - type: custom:decluttering-card
        template: iblinds
        variables:
          - blind: kitchen_blind_2
          - display_name: Blind 2
      - type: custom:decluttering-card
        template: iblinds
        variables:
          - blind: kitchen_blind_3
          - display_name: Blind 3
view_layout:
  column: 1

image

type: custom:mod-card
card_mod:
  style:
    hui-horizontal-stack-card $: |
      div#root > :first-child {
        width: 66%;
        flex: auto; 
      }
      div#root > :last-child {
        width: 33%;
        flex: auto; 
      }
card:
  type: horizontal-stack
  cards:
    - type: vertical-stack
      cards:
        - type: vertical-stack
          cards:
            - type: custom:mushroom-title-card
              title: ''
              subtitle: Living Room
              alignment: center
            - type: horizontal-stack
              cards:
                - type: custom:decluttering-card
                  template: iblinds
                  variables:
                    - blind: living_room_blind
                    - display_name: Window
                - type: custom:decluttering-card
                  template: iblinds
                  variables:
                    - blind: patio_door_blind
                    - display_name: Patio Door
    - type: vertical-stack
      cards:
        - type: custom:mushroom-title-card
          title: ''
          subtitle: Master Bedroom
          alignment: center
        - type: horizontal-stack
          cards:
            - type: custom:decluttering-card
              template: iblinds
              variables:
                - blind: bedroom_blind
                - display_name: Window
view_layout:
  column: 1

image

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

8 participants