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

Cannot generate woff / woff2 font with node v10.1.0 #166

Closed
lpillonel opened this Issue May 18, 2018 · 18 comments

Comments

Projects
None yet
8 participants
@lpillonel

lpillonel commented May 18, 2018

I just updated my gulp workflow setup to node v10.1.0 and everything is working except gulp-icofont when generating woff font. If I remove woff from the formats list, it works as expected (the font is generated).

My task is :

gulp.task('icons', function(){
    return gulp.src('./src/icons/*.svg')
        .pipe(iconfont({
            fontName: `fontname`,
            fontHeight: 1000,
            normalize: true,
            formats: ['woff'],
        }))
        .pipe(gulp.dest('./assets/'));
});

it fails with

[14:23:12] gulp-svgicons2svgfont: Font created

events.js:167
      throw er; // Unhandled 'error' event
      ^
Error: Checksum error in glyf
error Command failed with exit code 1.

If I try with woff2

gulp.task('icons', function(){
    return gulp.src('./src/icons/*.svg')
        .pipe(iconfont({
            fontName: `fontname`,
            fontHeight: 1000,
            normalize: true,
            formats: ['woff2'],
        }))
        .pipe(gulp.dest('./assets/'));
});

it fails with

[14:31:26] Starting 'icons'...
[14:31:26] gulp-svgicons2svgfont: Font created

events.js:167
      throw er; // Unhandled 'error' event
      ^
Error: Could not convert the given font.
    at Transform.ttf2woff2GulpTransform [as _transform] (/data/node_modules/gulp-ttf2woff2/src/index.js:76:25)
    at Transform._read (/data/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at Transform._write (/data/node_modules/readable-stream/lib/_stream_transform.js:172:83)
    at doWrite (/data/node_modules/readable-stream/lib/_stream_writable.js:428:64)
    at writeOrBuffer (/data/node_modules/readable-stream/lib/_stream_writable.js:417:5)
    at Transform.Writable.write (/data/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at PassThrough.ondata (/data/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at PassThrough.emit (events.js:182:13)
    at addChunk (/data/node_modules/readable-stream/lib/_stream_readable.js:291:12)
    at readableAddChunk (/data/node_modules/readable-stream/lib/_stream_readable.js:278:11)
    at PassThrough.Readable.push (/data/node_modules/readable-stream/lib/_stream_readable.js:245:10)
    at PassThrough.Transform.push (/data/node_modules/readable-stream/lib/_stream_transform.js:148:32)
    at PassThrough.afterTransform (/data/node_modules/readable-stream/lib/_stream_transform.js:91:10)
    at PassThrough._transform (/data/node_modules/readable-stream/lib/_stream_passthrough.js:46:3)
    at PassThrough.Transform._read (/data/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at PassThrough.Transform._write (/data/node_modules/readable-stream/lib/_stream_transform.js:172:83)
Emitted 'error' event at:
    at StreamFilter.Duplexer._readable.on.err (/data/node_modules/plexer/src/index.js:66:13)
    at StreamFilter.emit (events.js:187:15)
    at Transform.require.on (/data/node_modules/gulp-iconfont/src/index.js:70:19)
    at Transform.emit (events.js:187:15)
    at Transform.ttf2woff2GulpTransform [as _transform] (/data/node_modules/gulp-ttf2woff2/src/index.js:78:16)
    at Transform._read (/data/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    [... lines matching original stack trace ...]
    at PassThrough.Transform.push (/data/node_modules/readable-stream/lib/_stream_transform.js:148:32)
error Command failed with exit code 1.

Everything was working as expected with node v9.11.1.

@lpillonel lpillonel changed the title from Cannot generate WOFF font with node v10.1.0 to Cannot generate woff / woff2 font with node v10.1.0 May 18, 2018

@nfroidure

This comment has been minimized.

Owner

nfroidure commented May 19, 2018

May be linked to nfroidure/svg-pathdata#33

@Sir-Genius

This comment has been minimized.

Sir-Genius commented May 21, 2018

I’m dealing with the same problem. Gulp-iconfont works fine with all font formats but woff.

[18:46:18] Using gulpfile ~\Desktop\Gulp\gulpfile.js
[18:46:18] Starting 'font-generate'...
[18:46:19] gulp-svgicons2svgfont: Font created
[18:46:19] 'font-generate' errored after 1.1 s
[18:46:19] Error in plugin 'gulp-ttf2woff'
...

@schliesser

This comment has been minimized.

schliesser commented Jun 5, 2018

Hey, I'm having also trouble with node 10.3.0.

First I had this error:

Starting 'font'...
Finished 'font' after 451 ms
gulp-svgicons2svgfont: Font created

/path/to/project/node_modules/ttf2woff2/jssrc/ttf2woff2.js:1
(function (exports, require, module, __filename, __dirname) { var Module;if(!Module)Module=(typeof Module!=="undefined"?Module:null)||{};var moduleOverrides={};for(var key in Module){if(Module.hasOwnProperty(key)){moduleOverrides[key]=Module[key]}}var ENVIRONMENT_IS_WEB=typeof window==="object";var ENVIRONMENT_IS_WORKER=typeof importScripts==="function";var ENVIRONMENT_IS_NODE=typeof process==="object"&&typeof require==="function"&&!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_WORKER;var ENVIRONMENT_IS_SHELL=!ENVIRONMENT_IS_WEB&&!ENVIRONMENT_IS_NODE&&!ENVIRONMENT_IS_WORKER;if(ENVIRONMENT_IS_NODE){if(!Module["print"])Module["print"]=function print(x){process["stdout"].write(x+"\n")};if(!Module["printErr"])Module["printErr"]=function printErr(x){process["stderr"].write(x+"\n")};var nodeFS=require("fs");var nodePath=require("path");Module["read"]=function read(filename,binary){filename=nodePath["normalize"](filename);var ret=nodeFS["r
Error: Checksum error in glyf

Then I added "node-sass":"^4.9.0" to my package.json. Like it is mentioned here: https://stackoverflow.com/questions/41773047/gulp-task-error-checksum-error-in-glyf/41796973#41796973
Now I have the same error like above:

Starting 'font'...
Finished 'font' after 241 ms
gulp-svgicons2svgfont: Font created

events.js:167
      throw er; // Unhandled 'error' event
      ^
Error: Could not convert the given font.
    at Transform.ttf2woff2GulpTransform [as _transform] (/path/to/project/node_modules/gulp-ttf2woff2/src/index.js:76:25)
    at Transform._read (/path/to/project/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at Transform._write (/path/to/project/node_modules/readable-stream/lib/_stream_transform.js:172:83)
    at doWrite (/path/to/project/node_modules/readable-stream/lib/_stream_writable.js:418:64)
    at writeOrBuffer (/path/to/project/node_modules/readable-stream/lib/_stream_writable.js:407:5)
    at Transform.Writable.write (/path/to/project/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Transform.ondata (/path/to/project/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at Transform.emit (events.js:182:13)
    at Transform.EventEmitter.emit (domain.js:460:23)
    at addChunk (/path/to/project/node_modules/readable-stream/lib/_stream_readable.js:291:12)
    at readableAddChunk (/path/to/project/node_modules/readable-stream/lib/_stream_readable.js:278:11)
    at Transform.Readable.push (/path/to/project/node_modules/readable-stream/lib/_stream_readable.js:245:10)
    at Transform.push (/path/to/project/node_modules/readable-stream/lib/_stream_transform.js:148:32)
    at Transform.stream._transform (/path/to/project/node_modules/gulp-ttf2woff/src/index.js:58:16)
    at Transform._read (/path/to/project/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    at Transform._write (/path/to/project/node_modules/readable-stream/lib/_stream_transform.js:172:83)
    at doWrite (/path/to/project/node_modules/readable-stream/lib/_stream_writable.js:418:64)
    at writeOrBuffer (/path/to/project/node_modules/readable-stream/lib/_stream_writable.js:407:5)
    at Transform.Writable.write (/path/to/project/node_modules/readable-stream/lib/_stream_writable.js:334:11)
    at Transform.ondata (/path/to/project/node_modules/readable-stream/lib/_stream_readable.js:619:20)
    at Transform.emit (events.js:182:13)
    at Transform.EventEmitter.emit (domain.js:460:23)
Emitted 'error' event at:
    at Duplexer.EventEmitter.emit (domain.js:455:12)
    at PassThrough.Duplexer._readable.on.err (/path/to/project/node_modules/plexer/src/index.js:66:13)
    at PassThrough.emit (events.js:187:15)
    at PassThrough.EventEmitter.emit (domain.js:442:20)
    at Transform.require.on (/path/to/project/node_modules/gulp-iconfont/src/index.js:70:19)
    at Transform.emit (events.js:187:15)
    at Transform.EventEmitter.emit (domain.js:442:20)
    at Transform.ttf2woff2GulpTransform [as _transform] (/path/to/project/node_modules/gulp-ttf2woff2/src/index.js:78:16)
    at Transform._read (/path/to/project/node_modules/readable-stream/lib/_stream_transform.js:184:10)
    [... lines matching original stack trace ...]
    at Transform._read (/path/to/project/node_modules/readable-stream/lib/_stream_transform.js:184:10)
@NaridaL

This comment has been minimized.

Collaborator

NaridaL commented Jun 5, 2018

@nfroidure I don't see how this can be related to SVGPathData, as neither woff nor ttf are SVG based?

@nfroidure

This comment has been minimized.

Owner

nfroidure commented Jun 6, 2018

@NaridaL this plugins converts SVG files to a SVG font and then to a TTF one to finally convert it to a WOFF One. That said, it may not be linked at all.

@NaridaL

This comment has been minimized.

Collaborator

NaridaL commented Jun 6, 2018

I've added node 10 to the CI build, and it fails there too, however it's never run properly on my windows environment, and I don't use this package, so I can't really debug this issue.

@geosenna

This comment has been minimized.

geosenna commented Jun 7, 2018

+1

1 similar comment
@haasontwerp

This comment has been minimized.

haasontwerp commented Jun 11, 2018

+1

@NaridaL

This comment has been minimized.

Collaborator

NaridaL commented Jun 13, 2018

v10.0.0 should fix this. Please close if so.

@geosenna

This comment has been minimized.

geosenna commented Jun 13, 2018

Now I get this issue:

[12:08:36] Starting 'buildICON'...
[12:08:37] 'buildICON' errored after 123 ms
[12:08:37] Error: write after end
@NaridaL

This comment has been minimized.

Collaborator

NaridaL commented Jun 13, 2018

@geosenna I changed some of the stream handling, which might fix this. Try 10.0.1. Otherwise, I can't do anything without more details (Travis build is passing now...).

@Sir-Genius

This comment has been minimized.

Sir-Genius commented Jun 13, 2018

My issue was solved. @NaridaL, thank you!

@lpillonel

This comment has been minimized.

lpillonel commented Jun 13, 2018

It's ok also for me 🥇
Thanks a lot @NaridaL for your work! 🙇

@lpillonel lpillonel closed this Jun 13, 2018

@geosenna

This comment has been minimized.

geosenna commented Jun 13, 2018

Thanks a lot @NaridaL, it is working fine now with the 10.0.1.

@schliesser

This comment has been minimized.

schliesser commented Jun 13, 2018

Thx for fixing it. For me v10.0.1 fixed the issue.

@AnastasiaD

This comment has been minimized.

AnastasiaD commented Jul 4, 2018

@NaridaL, @geosenna, @schliesser hi, how did you change the version to 10.0.1? I have 10.5.0 now and get the same error. I haven't found 10.0.1 in nodejs releases, only 10.0.0.
Thanks!

@NaridaL

This comment has been minimized.

Collaborator

NaridaL commented Jul 4, 2018

@AnastasiaD version 10.0.1 of gulp-iconfont, not of nodejs itself.

@AnastasiaD

This comment has been minimized.

AnastasiaD commented Jul 4, 2018

Thanks @NaridaL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment