Skip to content
This repository has been archived by the owner on Mar 5, 2018. It is now read-only.

Bug - 'gulp-svg2png' fails during build on Windows #255

Closed
ashnewport opened this issue Aug 5, 2016 · 3 comments · Fixed by #261
Closed

Bug - 'gulp-svg2png' fails during build on Windows #255

ashnewport opened this issue Aug 5, 2016 · 3 comments · Fixed by #261

Comments

@ashnewport
Copy link

What I did

Cloned the repo then ran npm install and gulp build having made no modifications to the code at this point.

What browser and device I was using

Windows 10, Git Bash

What I expected to see

Style guide build completed successfully! logged in the terminal window.

What I saw

[09:19:22] Starting 'svg2png'...

C:\Users\Ash\Documents\Work\gov-au-ui-kit\node_modules\gulp-svg2png\index.js:49
        throw new gutil.PluginError(PLUGIN_NAME, message);
        ^
Error: Error while converting image.Error: TypeError: 'undefined' is not a function (evaluating 'el.getBBox()')

  phantomjs://webpage.evaluate():5
  phantomjs://webpage.evaluate():35
  phantomjs://webpage.evaluate():35
Unable to calculate dimensions.
TypeError: 'null' is not an object (evaluating 'dimensions.width')

Additional information (optional)

Adding XML declaration to the start of .svg files where it was missing solves the issue.

<?xml version="1.0" encoding="UTF-8"?>

If the above was omitted for optimisation but again needs to be included for Windows to play nice, perhaps the addition of SVG Optimizer might come in handy. Node package for Gulp is gulp-svgo.

@TrebBrennan
Copy link
Contributor

@maxious FYI

@klepas
Copy link
Contributor

klepas commented Aug 5, 2016

@ashnewport what an awesome bug report — thank you. :D

@elisechant
Copy link

it's going to be hard to support Windows cli. Recommend vagrant environment option or ignore Windows. Windows is notoriously horrible on CL.

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

Successfully merging a pull request may close this issue.

4 participants