-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specific SVG causes SVGO to fail: TypeError: Cannot read properties of undefined (reading '0') Edit: Bug is worse than I thought, SVGO corrupts all SVGs before encountering the invalid SVG. #1974
Comments
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 Here is a zip file of SVGs: The "bad" SVG in this collection is
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. |
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.
Read the comments, glad to hear a fix is in the works. |
Describe the bug
SVGO is choking on a specific SVG file.
To Reproduce
Steps to reproduce the behavior:
Or paste this into a new text file and save with an SVG extension:
svgo '.\Azure Media Player Audio Only B.svg'
Expected behavior
SVGO optimizes the SVG.
Or in the case of optimizing a folder, SVGO gracefully recovers from the error when processing a directory containing a bad SVG and continues processing other SVGs in the folder.
Desktop (please complete the following information):
Additional context
None
The text was updated successfully, but these errors were encountered: