CLI breaks when hitting SVGs
See original GitHub issueWhen the directory contains an svg file the CLI stops with the following error.
TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string or an instance of Buffer or URL. Received undefined
at Object.statSync (node:fs:1529:10)
at /Users/###/node_modules/@funboxteam/optimizt/lib/optimize.js:76:18
at Array.forEach (<anonymous>)
at optimize (/Users/###/node_modules/@funboxteam/optimizt/lib/optimize.js:74:15)
at async optimizt (/Users/###/node_modules/@funboxteam/optimizt/index.js:18:5) {
code: 'ERR_INVALID_ARG_TYPE'
}
When I add filtering for errors via const tasksResult = (await Promise.all(tasks)).filter(res => !!res);
in optimize.js
I see the following output for those svg files:
✖ /Users/###/src/images/###.svg
parseName is not a function
The SVG issue might be introduced in https://github.com/funbox/optimizt/commit/f4510cb139c047e4eb84a2e80915d4daca1b4d09.
But error filtering should be applied in any case.
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
All SVGs on site now broken - WordPress.org
Hi there, All SVGs on my site are now broken and no longer appearing. Did something change recently? ... You can do this...
Read more >5 Most Common Problems Faced by SVG Users - Vecta.io
1. Missing fonts · A. Wrongly declared font name · B. You're using <img> or background image to embed your SVG · C....
Read more >Three Ways of Decreasing SVG File Size with SVGO - SitePoint
The big advantage of not being pixel-based is that SVGs look ... However, you need to use your computer's command line user interface...
Read more >Production build optimization breaks code #11439 - GitHub
The optimization step should optimize, but never break code. ... should be written, the CLI should try not to break existing code, instead....
Read more >Clipping in CSS and SVG — The clip-path Property and ...
Both CSS and SVG allow us to "clip" elements into custom non-rectangular shapes. In this article we will go over the clipping techniques...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
👌 this works now and processes also the svg files! Thanks for your care! I wish I had raised my concerns about
require('../node_modules/svgo/...
earlier.@igoradamenko @343dev There seems to be another issue: