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
As the title states, the plugin reusePaths implicitly depends on removeXMLProcInst being enabled. I think this should be at least documented – better fixed.
If a document has an XML processing instruction and the plugin removeXMLProcInst is disabled, then said element is preceding the root element, which the implementation of the reusePaths does not properly handle. This causes the following crash:
TypeError: Cannot read property 'splice' of undefined
at module.exports.JSAPI.spliceContent (<#REDACTED#>/node_modules/svgo/lib/svgo/jsAPI.js:135:25)
at Object.exports.fn (<#REDACTED#>/node_modules/svgo/plugins/reusePaths.js:126:19)
at <#REDACTED#>/node_modules/svgo/lib/svgo/plugins.js:95:27
at Array.forEach (<anonymous>)
at full (<#REDACTED#>/node_modules/svgo/lib/svgo/plugins.js:93:13)
at <#REDACTED#>/node_modules/svgo/lib/svgo/plugins.js:25:24
at Array.forEach (<anonymous>)
at module.exports (<#REDACTED#>/node_modules/svgo/lib/svgo/plugins.js:15:13)
at <#REDACTED#>/node_modules/svgo/lib/svgo.js:70:17
at SAXParser.sax.onend (<#REDACTED#>/node_modules/svgo/lib/svgo/svg2js.js:169:13)
As the title states, the plugin reusePaths implicitly depends on removeXMLProcInst being enabled. I think this should be at least documented – better fixed.
If a document has an XML processing instruction and the plugin
removeXMLProcInst
is disabled, then said element is preceding the root element, which the implementation of the reusePaths does not properly handle. This causes the following crash:The problem is here:
svgo/plugins/reusePaths.js
Lines 124 to 126 in 07ca976
The text was updated successfully, but these errors were encountered: