Our website suddenly stopped working on Chrome (just chrome) after the latest update...
The error given is
Uncaught TypeError: Cannot read property 'numberOfItems' of undefined
This is where the numberOfItems property is used:
// Absolutize and parse path to array
, parse: function(array) {
/* if it's already is a patharray, no need to parse it */
if (array instanceof SVG.PathArray) return array.valueOf()
/* prepare for parsing */
var i, il, x0, y0, x1, y1, x2, y2, s, seg, segs
, x = 0
, y = 0
/* populate working path */
SVG.parser.path.setAttribute('d', typeof array === 'string' ? array : arrayToString(array))
/* get segments */
segs = SVG.parser.path.pathSegList
for (i = 0, il = segs.numberOfItems; i < il; ++i) {
seg = segs.getItem(i)
s = seg.pathSegTypeAsLetter
etc. (I didn't put the whole loop)
Why did SVG and Javascript stop being able to read this property after the latest Chrome update? What could be a good fix?
Thanks!!
Chrome removed the pathSeg interface in version 48.
There's more information in their public issue tracker
There's also an issue tracking the implementation of the replacement API in the meantime there are polyfills available to reinstate support for the old API
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With