Skip to content
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

Fix bug #97

Merged
merged 2 commits into from
Jan 6, 2020
Merged

Fix bug #97

merged 2 commits into from
Jan 6, 2020

Conversation

corollari
Copy link
Contributor

Bug

This svg image will cause the following error when applied to gulp-svgmin:

/home/corollari/projects/neo-mon/node_modules/svgo/plugins/convertPathData.js:766
        if (data[i].toFixed(precision) != data[i]) {
                    ^

TypeError: Cannot read property 'toFixed' of undefined
    at strongRound (/home/corollari/projects/neo-mon/node_modules/svgo/plugins/convertPathData.js:766:21)
    at /home/corollari/projects/neo-mon/node_modules/svgo/plugins/convertPathData.js:424:17
    at Array.filter (<anonymous>)
    at filters (/home/corollari/projects/neo-mon/node_modules/svgo/plugins/convertPathData.js:272:17)
    at Object.exports.fn (/home/corollari/projects/neo-mon/node_modules/svgo/plugins/convertPathData.js:79:20)
    at /home/corollari/projects/neo-mon/node_modules/svgo/lib/svgo/plugins.js:59:45
    at Array.filter (<anonymous>)
    at monkeys (/home/corollari/projects/neo-mon/node_modules/svgo/lib/svgo/plugins.js:46:39)
    at /home/corollari/projects/neo-mon/node_modules/svgo/lib/svgo/plugins.js:66:17
    at Array.filter (<anonymous>)

Solution

As discovered in this issue the problem seems to stem from the svgo dependency, which I have updated to a problem-free version. I haven't updated it to the latest version as it seems the same issue has reappeared in later versions (I haven't tested it tho).

@coveralls
Copy link

coveralls commented Jan 5, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 6aff57c on corollari:master into e5c2a75 on ben-eb:master.

@rejas
Copy link
Collaborator

rejas commented Jan 6, 2020

Thx for the PR @corollari but could you check why the travis builds fails?

@corollari
Copy link
Contributor Author

Just fixed the travis build 👍

@rejas rejas merged commit 8699df6 into ben-eb:master Jan 6, 2020
@madhaze
Copy link

madhaze commented Jun 24, 2020

Did this ever make it into a release? it looks like svgo is still at 1.2.1 on 2.2.0 release.

@rejas
Copy link
Collaborator

rejas commented Jun 25, 2020

You are right, this wasnt released yet.
Just published v3.0.0 with this fix and other stuff. Enjoy!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants