SyntaxError: Unexpected character "N" at index 42
Generating font kit from 9 SVG icons
events.js:167
throw er; // Unhandled 'error' event
^
SyntaxError: Unexpected character "N" at index 42.
at SVGPathDataParser._transform (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/src/SVGPathDataParser.js:461:28)
at SVGPathDataParser.Transform._read (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/node_modules/readable-stream/lib/_stream_transform.js:159:10)
at SVGPathDataParser.Transform._write (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/node_modules/readable-stream/lib/_stream_transform.js:147:83)
at doWrite (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/node_modules/readable-stream/lib/_stream_writable.js:313:64)
at writeOrBuffer (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/node_modules/readable-stream/lib/_stream_writable.js:302:5)
at SVGPathDataParser.Writable.write (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/node_modules/readable-stream/lib/_stream_writable.js:241:11)
at Function.SVGPathData.parse (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/src/SVGPathData.js:124:10)
at new SVGPathData (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/src/SVGPathData.js:4:31)
at /usr/local/lib/node_modules/icon-font-generator/node_modules/svgicons2svgfont/src/index.js:335:20
at Array.forEach (<anonymous>)
Emitted 'error' event at:
at SVGPathDataParser._transform (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/src/SVGPathDataParser.js:461:14)
at SVGPathDataParser.Transform._read (/usr/local/lib/node_modules/icon-font-generator/node_modules/svg-pathdata/node_modules/readable-stream/lib/_stream_transform.js:159:10)
[... lines matching original stack trace ...]
at Array.forEach (<anonymous>)```
npm -v
6.4.1
node -v
v10.12.0
I'm having the same problem. I found that only specific SVG files are throwing this error
Can I get the SVGs you guys are using? It looks to me from a brief look as if some SVG data might be corrupted
Same issue.. I am sending the svg file.. left-arrow.svg.zip
just stumbled upon this error and (in my particular case) fixed by cutting out svgs that had a "transform" element inside the path e.g. rotation.
Same error, fixed removing "transform" attribute.
I applied a regex in vscode to delete all ocurriences, could be useful: transform=(".+?")
Same error, fixed removing "transform" attribute.
I applied a regex in vscode to delete all ocurriences, could be useful: transform=(".+?")
@rjlopezdev Your fix worked for me.