Fixes: Cannot read properties of undefined (reading '_custom') by checking 'parsed' before using it#11581
Fixes: Cannot read properties of undefined (reading '_custom') by checking 'parsed' before using it#11581mbonaci wants to merge 3 commits into
Conversation
…re using it Fixes: Cannot read properties of undefined (reading '_custom') in Bar chart
|
I've faced this quite a similar issue and it might help, What I did was basically make pre - check the parent objects before accessing the children. Before the code accessed the chartInstance directly : When the component was initially being rendered the $context was almost always undefined. After placing the pre-checks , it negated the error as I placed its calling under an useEffect to keep checking until after the component was rendered completly. |
…'parsed' in not set Because a test was failing: Types of property 'value' are incompatible. Type 'number' is not assignable to type 'string'.
|
If both bar and donut charts have similar errors, then it seems ideal to instead find a common location to fix all controllers, if possible? I have an alternative candidate fix at #11596; I'm not sure if that approach is better or not. |
|
Resolved by 429d99d, closing. |
In
getLabelAndValue controller.bar.js.There's already a similar issue filed here: #11365
Though mine happens in bar charts and this one seems to be in the doughnut, but the issue is the same.
This illusive error happens very rarely and it turned out to be impossible to reproduce, but I keep getting this error from our users in our bug tracking system.
Please advise if you think there's a better way to fix the issue than to return a dummy label/value.
This
parsedthing is basically dataset meta that was previously cached.