Comments (3)
Update to this issue. The severity is much higher than I thought.
I found another SVG causing SVGO to fail, but the terrible part is when I process a folder of SVGs that also contains the "bad" SVG using svgo -r -f 'C:\Icons\SomeFolderWithSVGs\'
, SVGO deletes all data from valid SVGs up until it reaches the "bad" SVG. So it's corrupting completely valid SVGs and causing data loss.
Here is a zip file of SVGs:
The "bad" SVG in this collection is brand-instagram-65369.svg
- Extract the zip somewhere, I.E.
C:\Microsoft Docons\
- Open a terminal and enter
svgo -r -f 'C:\Microsoft Docons\'
- You should see the same error I pasted in my first post.
- Open
C:\Microsoft Docons\
, and observe that these (valid) SVGs are now empty files:
.notdef-1114112.svg
arrow-down-65312.svg
arrow-down8-61614.svg
arrow-left-65313.svg
arrow-right-65305.svg
arrow-swap-65392.svg
arrow-up-left-65304.svg
arrow-up-right-61545.svg
arrow-up8-61613.svg
asterisk-59960.svg
asterisk-solid-62285.svg
backpack-65413.svg
blog-61995.svg
book-art64-61204.svg
book-open-65382.svg
book-solid-65365.svg
brand-dev-to-65368.svg
brand-facebook-65300.svg
brand-github-65302.svg
Definitely a pretty nasty bug. Having SVGO choke on a file is one thing, but corrupting other valid files is pretty awful.
Hopefully there is a resolution to this.
from svgo.
SVGO deletes all data from valid SVGs
I believe this is due to how Node handles the priority of events and stuff.
Cannot read properties of undefined (reading '0')
Duplicate of #1926, also see comments on #1927
from svgo.
SVGO deletes all data from valid SVGs
I believe this is due to how Node handles the priority of events and stuff.
Can you elaborate on this? Is there any way to mitigate this behavior? I can't safely use SVGO in production if there is a chance that somewhere in the pipeline valid data gets wiped out.
Cannot read properties of undefined (reading '0')
Read the comments, glad to hear a fix is in the works.
from svgo.
Related Issues (20)
- [cleanupIDs] symbol is incorrectly removed when its ID is *NOT* used by URL-encoded reference
- Missing a ';' after converting svg with png;base64 HOT 1
- SVGO 3.3.0 stopped working in the AWS environment with Node.js 20 HOT 2
- Version 3.3.0 break commonjs exports
- Package.exports types file specification missing HOT 2
- `package.json`/ `dist/svgo.browser.js` are no longer exported HOT 8
- Unable to install [email protected] HOT 3
- Option to resize SVGs to custom dimesnions HOT 4
- Remove consecutive points in linear path string if they have zero length or direction does not change HOT 1
- 'Cannot read properties of undefined' error in reflectPoint
- An idea to round/rewrite elements with gradient
- v4.0 rc - import plugin utils, e.g xast.js HOT 4
- Mask colors are changed when using convertColors and currentColor: true
- RFC: Defining a General Preset for SVG Sprites
- Paths won't merge HOT 1
- Feature Request: Add Option to Remove Invisible Items HOT 1
- Multiple issues with styles / css HOT 1
- --datauri 'unenc' add 'data:image/svg+xml,data:image/svg+xml,'
- Error: Unmatched selector: % HOT 3
- [FEATURE REQUEST]: Option to hide SVGs that were optimised by 0%
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from svgo.