You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot read properties of null (reading 'addEventListener') #11295
I'm having difficulty grasping the purpose of this issue. What's the rationale behind passing a null instead of a canvas element? Even if null is passed, it would be detected and reported earlier in the stack trace. If I am misunderstanding the intent of this issue, could you please provide more details and instructions to reproduce the problem? Otherwise, it appears to be a non-issue.
Do you consider this issue to be a genuine concern? It appears that the creator of the issue has remained unresponsive despite the comment above. I would like to hear your thoughts on whether this issue can be closed. Considering that a potential bug like this would likely have been identified and addressed earlier, it raises doubts about the significance of this reported problem. Plus, it would be nice to have one less issue open.
I'll check again this Tuesday... I think it's related to a browser problem...
I restarted my MacBook and this problem seems to be gone... I will reopen it if I see any problem appear again
I was trying to use the chartjs-chart-graph plugin, but ChartJS errors out in the function as described above because, somehow, chart.canvasis in fact null.
Perhaps the plugin in my case is trying to do something before the chart is fully initialized, but I've yet to find it. If I change the chart type to e.g. line and then to tree, it does work as a canvas is now created, but on resize, it becomes null again.
Also, this is using react-chartjs-2. Adding redraw={true} to the Chart, still shows the error from above twice, but after that it seems to work.
@mukham12 I'm also hitting this with react-chartjs-2 using the Doughnut chart from Chart.js. Any ideas on how to fix this? Should we add the conditional checks to chart.js to ensure that addEventListener and removeEventListener is only called on a canvas object?
Whats the solution to this issue, @DAcodedBEAT could you please explain how to this check , I am facing this is react-chartjs2 LineChart component
@guru-keepspace I fixed the issue in the underlying chartjs library so this doesn't happen but as a result, other issues were uncovered - the latest one: #11809
Activity
mukham12 commentedon May 19, 2023
I'm having difficulty grasping the purpose of this issue. What's the rationale behind passing a
nullinstead of a canvas element? Even ifnullis passed, it would be detected and reported earlier in the stack trace. If I am misunderstanding the intent of this issue, could you please provide more details and instructions to reproduce the problem? Otherwise, it appears to be a non-issue.mukham12 commentedon May 21, 2023
@etimberg,
Do you consider this issue to be a genuine concern? It appears that the creator of the issue has remained unresponsive despite the comment above. I would like to hear your thoughts on whether this issue can be closed. Considering that a potential bug like this would likely have been identified and addressed earlier, it raises doubts about the significance of this reported problem. Plus, it would be nice to have one less issue open.
Thanks.
donavan-tangible commentedon May 21, 2023
I'll check again this Tuesday... I think it's related to a browser problem...
I restarted my MacBook and this problem seems to be gone... I will reopen it if I see any problem appear again
mukham12 commentedon May 21, 2023
Thanks @donavan-tangible. Please do re-open in case this problem persists. Also, please provide a reproducible sample if possible!
ThenTech commentedon Sep 6, 2023
I was trying to use the chartjs-chart-graph plugin, but ChartJS errors out in the function as described above because, somehow,
chart.canvasis in fact null.Perhaps the plugin in my case is trying to do something before the chart is fully initialized, but I've yet to find it. If I change the chart type to e.g. line and then to tree, it does work as a canvas is now created, but on resize, it becomes null again.
Also, this is using
react-chartjs-2. Addingredraw={true}to the Chart, still shows the error from above twice, but after that it seems to work.DAcodedBEAT commentedon Feb 2, 2024
@mukham12 I'm also hitting this with react-chartjs-2 using the Doughnut chart from Chart.js. Any ideas on how to fix this? Should we add the conditional checks to chart.js to ensure that addEventListener and removeEventListener is only called on a canvas object?
guru-keepspace commentedon Jul 21, 2024
Whats the solution to this issue, @DAcodedBEAT could you please explain how to this check , I am facing this is react-chartjs2 LineChart component
DAcodedBEAT commentedon Jul 21, 2024
@guru-keepspace I fixed the issue in the underlying chartjs library so this doesn't happen but as a result, other issues were uncovered - the latest one: #11809
Best of luck!