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

Misleading error reported due to control flow in config check #53

Open
teskanoo opened this issue Oct 11, 2022 · 0 comments
Open

Misleading error reported due to control flow in config check #53

teskanoo opened this issue Oct 11, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@teskanoo
Copy link

Checklist:

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

Release with the issue:
Version 0.6.3
Last working release (if known):

Browser and Operating System:

Windows Chrome

Description of problem:

I'm seeing this in the front-end but it took me a while to track it down as the error is a bit misleading.

image

The cause of the issue is in fact that I forgot to add the object decluttering_templates to my main lovelace config

The error occurs when the code is checking that decluttering exists in the config (js object)

These line numbers are not going to help but I'm sure you can find the code

image

The exception on line 1717 never gets thrown because of the way the the pre-check is being done

I think you need...
if (!t.config || ('decluttering_templates' in !t.config))

When I run this in the console it behaves as expected

image

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


Additional information:

@teskanoo teskanoo added the bug Something isn't working label Oct 11, 2022
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

1 participant