AalianKhan / mushroom-strategy

A strategy to automatically generate a dashboard using mushroom cards
MIT License
364 stars 36 forks source link

TypeError: Cannot convert undefined or null to object #114

Closed clowgg closed 6 months ago

clowgg commented 7 months ago

Describe the bug I get the following error when clicking on any of the areas/rooms icons on the Home page:

Error loading the view strategy:

TypeError: Cannot convert undefined or null to object

Versions

To Reproduce Steps to reproduce the behavior:

  1. Open Strategy dashboard
  2. Click on any Area
  3. See error as above

Screenshots image image

Additional context This was only happening on my iOS devices in the Companion App initially, but after a restart of the HA server, it started happening on the PC using either Edge (120.0.2210.133 (Official build) (64-bit)) or Firefox (121.0.1).

clowgg commented 7 months ago

Here is the error console from Edge:

image

DigiLive commented 7 months ago

The strategy is unable to load one of its classes (Helper). I suspect due to an error of/clash with one of the other packages you've installed.

Try disabling the resources at https://my.home-assistant.io/redirect/lovelace_resources/ by changing the resource's name to something non existing. E.g. /hacsfiles/some-plugin/some-plugin.js to /hacsfiles/some-plugin/some-plugin.js.disabled.

Keep the following resources enabled:

Make sure you refresh the cache and see what the outcome is of disabling the resources.

If the error is gone, one of the disabled resources is clashing with the strategy. Then enable them one by one again (by restoring the resource's name) to determine which other resource causes the error.

clowgg commented 7 months ago

Ok - thank you for the help! I will try this in the morning.

clowgg commented 7 months ago

I disabled all the resources except the 3 you listed, and the error still happens :(

I restarted HA after doing the edits, restarted Edge browser and used Ctrl-F5 to reload the dashboard page.

image

On iOS there is an additional bit of info in the error msg:

(evaluating 'Object.keys(t)')

DigiLive commented 7 months ago

If I'm not mistaken, the following resources are still loaded:

Also, I see Dwains Dashboard is loaded. You can disable it at the integration settings.

Side-note: To exclude a possible corrupt download of the strategy, you could try to re-download (a later version) with HACS or it or download and replace the file manually at your hass instance.

Doing my best over here, but it's hard to "debug" this way, since I can't reproduce the error.

@AalianKhan Any sight on release v2, the typescript version?

AalianKhan commented 7 months ago

@DigiLive I wanted to get over the device card PR over with but since that is taking longer, I will go ahead and release it.

clowgg commented 7 months ago

I disabled ampli-panel & card-mod via configuration.yaml, and I disabled Dwains Dashboard via the integration, then restarted HA. The issue with Strategy still persists.

I then tried downloading the Strategy add-on again via HACS. Couldn't see a way to re-download (without removing the add-on first). So I manually downloaded the mushroom-strategy.js file and replaced the one in www\community\mushroom-strategy. Restarted HA and the problem persisted.

I went back into Dashboard resources and re-disabled all the other resources - restarted, and the problem persists!

I'm at a loss.

clowgg commented 6 months ago

@DigiLive I wanted to get over the device card PR over with but since that is taking longer, I will go ahead and release it.

When do you expect this new release to be done @AalianKhan ?

clowgg commented 6 months ago

Ah! Just got the notification in HACS that the new version 2.0 is released. I have upgraded and rebooted HA. I created a new dashboard, and the Area rooms are working :)

The previous dashboard has not been fixed by this update - is that expected?

Edit: Oh - just did a restart of the Browser, and now the old one is working :-)

DigiLive commented 6 months ago

@clowgg Does this mean this issue can be closed?

clowgg commented 6 months ago

I did think so earlier today, but I've had inconsistent results with the dashboard since. The browser seems to get confused and you get an error trying to load the Area pages, and then a restart of the browser may fix it.

I'm still getting an error on iOS with the new dashboard.

image

DigiLive commented 6 months ago

Unfortunately, I still need to see console output.

Also, which version of iOS do you use?

clowgg commented 6 months ago

It’s ok now that I have recreated the db and not ‘taken ownership’

AalianKhan commented 6 months ago

Issue can be closed?