Open futuremotiondev opened 4 months ago
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
C:\Microsoft Docons\
svgo -r -f 'C:\Microsoft Docons\'
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.
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
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')
Duplicate of #1926, also see comments on #1927
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