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

When error occurred in webfonts-generator, script is broken. #35

Closed
wszhi opened this issue Jun 29, 2018 · 4 comments
Closed

When error occurred in webfonts-generator, script is broken. #35

wszhi opened this issue Jun 29, 2018 · 4 comments

Comments

@wszhi
Copy link

wszhi commented Jun 29, 2018

When I only generate one svg image to icon-font. The error occurred as below:

$ icon-font-generator src/assets/icons/*.svg -o icon-dist
Generating font kit from 1 SVG icons
(node:34523) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'red' of undefined
    at fail (/Users/XXX/XX/XXXXX/node_modules/icon-font-generator/bin/icon-font-generator:88:31)
    at fontGenerator.generate.catch.err (/Users/XXX/XX/XXXXX/node_modules/icon-font-generator/bin/icon-font-generator:77:79)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
(node:34523) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:34523) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
✨  Done in 0.41s.

I debug the code and find webfonts-generator will return a error " Fail! Checksum error in glyf".
This error is a string, so "err.message.red" will return this error, and script will be broken.

function fail(err) {
  if (typeof err === 'string' || err instanceof errors.ValidationError) {
    console.error(err.message.red)
    process.exit()
  }

  if (err instanceof Error) { throw err }
}
@vahidshirvani
Copy link

I ran into the same issue.

@tancredi
Copy link
Contributor

Thanks for reporting - upgrading to 2.1.8 should fix (#37) - please re-open it the issue persists.

@vahidshirvani
Copy link

Yes, it will generate a better error message but the problem will still persist. The issue lays in one of the dependencies. Take a look at this thread

@tancredi
Copy link
Contributor

As long as the error outputting is solved here I'll keep this closed - thanks

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

No branches or pull requests

3 participants