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

Errors are flooding the Log (probably in case of wrong user's code) #383

Closed
ildar170975 opened this issue Mar 21, 2024 · 6 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@ildar170975
Copy link

ildar170975 commented Mar 21, 2024

Checklist:

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

Release with the issue:
v0.1.6-beta.0

Last working release (if known):

Browser and Operating System:
Chrome 123.0.6312.59 (win10x64)

Description of problem:

Noticed that the Log is flooded by these errors:


2024-03-21 16:11:25.908 ERROR (MainThread) [frontend.js.latest.202403070] Uncaught error from Chrome 123.0.0.0 on Windows 10
IndexSizeError: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-25) is negative.
v (/hacsfiles/lovelace-fluid-level-background-card/fluid-level-background-card.js:181:1290)
2024-03-21 16:11:25.909 ERROR (MainThread) [frontend.js.latest.202403070] Uncaught error from Chrome 123.0.0.0 on Windows 10
IndexSizeError: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-25) is negative.
v (/hacsfiles/lovelace-fluid-level-background-card/fluid-level-background-card.js:181:1290)
2024-03-21 16:11:25.909 ERROR (MainThread) [frontend.js.latest.202403070] Uncaught error from Chrome 123.0.0.0 on Windows 10
IndexSizeError: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-25) is negative.
v (/hacsfiles/lovelace-fluid-level-background-card/fluid-level-background-card.js:181:1290)
2024-03-21 16:11:25.910 ERROR (MainThread) [frontend.js.latest.202403070] Uncaught error from Chrome 123.0.0.0 on Windows 10
IndexSizeError: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-25) is negative.
v (/hacsfiles/lovelace-fluid-level-background-card/fluid-level-background-card.js:181:1290)
2024-03-21 16:11:25.910 ERROR (MainThread) [frontend.js.latest.202403070] Uncaught error from Chrome 123.0.0.0 on Windows 10
IndexSizeError: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-25) is negative.
v (/hacsfiles/lovelace-fluid-level-background-card/fluid-level-background-card.js:181:1290)
2024-03-21 16:11:25.911 ERROR (MainThread) [frontend.js.latest.202403070] Uncaught error from Chrome 123.0.0.0 on Windows 10
IndexSizeError: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-25) is negative.
v (/hacsfiles/lovelace-fluid-level-background-card/fluid-level-background-card.js:181:1290)


Here is only a tiny amount of same messages. They are raised in a large amount within a small time interval.
Probably these errors are caused by a wrong user's code in the card config (I played with differently defined level_color).
Suggest to avoid this extensive generation of errors; some messages are surely should be reported - but not with this high frequency.

Javascript errors shown in the web inspector (if applicable):
I did not notice errors in console.
May be there were in fact.

Additional information:

@ildar170975 ildar170975 added the bug Something isn't working label Mar 21, 2024
@swingerman swingerman self-assigned this Mar 21, 2024
@swingerman
Copy link
Owner

swingerman commented Mar 21, 2024

The errors you shared indicate something not related to the level_color.

Could you share a screenshot of your card in Lovelace when this happens?

@ildar170975
Copy link
Author

I tried to reproduce the case.
Here is a code:

type: custom:fluid-level-background-card
card:
  type: glance
  entities:
    - entity: sun.sun
      name: Beer level
entity: input_number.test_level_1
fill_entity: input_boolean.test_boolean
level_color:
  - 242
  - 142
  - 28

изображение

What I did:

  1. Edit a value of level_color - remove a list, start typing smth like
level_color: [

adding smth in this line, removing etc.
2. And once I reproduced these errors - but have not noticed which exact change caused it, just saw same errors in the Log.
3. But I failed to reproduce it again.

@swingerman
Copy link
Owner

I see. While you are typing in the YAML editor, The card gets updated on each keystroke, resulting in invalid values that break the code.

@ildar170975
Copy link
Author

Probably, and as I said I could not reproduce it, a bit erratic glitch...
Actually, a lot of cards report errors while typing an incomplete code, I would consider this as a normal behaviour.
The issue is about a high frequency.

@swingerman
Copy link
Owner

please check v0.1.6-beta.2

@ildar170975
Copy link
Author

Started testing, see no errors so far.
Will report if I see them.
Thanks a lot!!!

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
Development

No branches or pull requests

2 participants