Fix helper._calculatePadding return NaN causes Maximum Call Stack Size Exceeded#6857
Fix helper._calculatePadding return NaN causes Maximum Call Stack Size Exceeded#6857etimberg merged 1 commit intochartjs:releasefrom
Conversation
|
I'm curious, when does this happen? |
|
It happens when the element is not yet attached to DOM, I think. My Angular project place that |
|
Another curiosity, does this change make it work alright? |
|
Yes, of course! |
|
I suppose resize gets called again, when attached to DOM. What browser are you testing with and did you test any others? |
|
I tested on Chrome, Firefox and Edge, it throws an exception in zone.js (Angular mechanism), I think. That causes the code for that component no further running.
|
|
#5955 is loosely related |
| *.swp | ||
| *.stackdump | ||
|
|
||
| chart.js-*.tgz |
There was a problem hiding this comment.
Similar to the dist folder, when you run npm pack, it will generate chart.js-<version>.tgz which use for local npm install. It may use for testing when the package is not uploaded to npmjs.
|
Thanks for the merge, btw can you guys update npm version tag? https://travis-ci.org/chartjs/Chart.js/builds/628564087#L5259 |

I encounter an issue that causes maximum call stack size exceeded in Chrome by using ng2-charts, found out that was in issue from this library.
The root cause from
helpers.getStyle()insidehelpers._calculatePadding()return an empty string, soparseInt()will result NaN that causefitBoxes()recursive called infinitively.