jaywcjlove / svgtofont

Read a set of SVG icons and ouput a TTF/EOT/WOFF/WOFF2/SVG font.
https://jaywcjlove.github.io/svgtofont
MIT License
538 stars 85 forks source link

Error with Cheerio #237

Open bug145 opened 1 month ago

bug145 commented 1 month ago

I am encountering this error, which is likely why the CSS file is not being created.

Here’s how I’m using it: svgtofont({ src: tempFolder, dist: dst, emptyDist: true, log: true, fontName: 'flux', css: false, svgicons2svgfont: { fixedWidth: true, centerHorizontally: true, normalize: true, fontHeight: 200, }, })

Here is the error message:

` SUCCESS SVG font successfully created! 18:35:30 ╰┈▶ C:\Users\user\projects\test\assets.font\icons\font.svg SUCCESS TTF font successfully created! 18:35:31 ╰┈▶ C:\Users\user\projects\test\assets.font\icons\font.ttf 18:35:31
SUCCESS EOT font successfully created! 18:35:31
╰┈▶ C:\Users\user\projects\test\assets.font\icons\font.eot SUCCESS WOFF font successfully created! 18:35:31 ╰┈▶ C:\Users\user\projects\test\assets.font\icons\font.woff 18:35:32 SUCCESS WOFF2 font successfully created! 18:35:32
╰┈▶ C:\Users\user\projects\test\assets.font\icons\font.woff2 SvgToFont:CLI:ERR: Cannot read properties of undefined (reading 'load') 18:35:32

at createSvgSymbol (node_modules\svgtofont\lib\utils.js:236:33) at exports.default (node_modules\svgtofont\lib\index.js:123:43) `

marcos-castrillo commented 1 month ago

I'm having the exact same error, it was working fine before. I'm using v4.2.2.

skyerday commented 1 month ago

cheerio 1.0.0 issue. workaround: rollback to 1.0.0-rc.12

Yarn "resolutions": { "cheerio": "1.0.0-rc.12" },

jaywcjlove commented 1 month ago

@skyerday @marcos-castrillo @bug145

jaywcjlove commented 1 month ago

@skyerday @marcos-castrillo @bug145 Upgrade to v5.0.3