chartjs/chartjs-plugin-deferred

Deferred update causes an uncaught error if `canvas` is destroyed

BR0kEN- opened this issue ยท 6 comments

It happens sometimes that canvas element and ctx are no longer exist during a deferred update. This causes errors like Cannot read property 'save' of null. To reproduce this behavior we have to construct a new chart and kill canvas before the delay is expired (e.g. when you navigate from one page to another without waiting for all charts to be rendered completely, including delayed updates).

Screenshot 2019-12-20 at 10 06 31
Screenshot 2019-12-20 at 10 06 48

any plan to incorporate @BR0kEN- fix to the main package? This error shows up in our E2E smoke testing suite as the test moves fast to the next screen without really leaving time for the chart to render.

There is no activity in this repo since 2018. I'm using "chartjs-plugin-deferred": "https://github.com/BR0kEN-/chartjs-plugin-deferred/tarball/v1.0.2", since the patch creation.

@ejosafat @BR0kEN- I'm really sorry, I wasn't able to work on this project when the patch has been submitted and then I forgot about it. I will try to review it as soon as possible and release a new version.

Fixed by #14 and released as part of v1.0.2.

Screenshot 2021-02-28 at 20 16 57

Hurray! Finally! Thanks!

thanks!