patrickhulce / fontmin-webpack

Minifies icon fonts to just the used glyphs.
MIT License
139 stars 19 forks source link

Node 12 support? #26

Closed blueskies79 closed 4 years ago

blueskies79 commented 4 years ago

Hi, Thanks so much for this package! My limited use of font-awesome is no longer a nightmare ;-)

I'm trying to debug an error I'm getting when installing fontmin-webpack on a node 12.14.1 (npm 6.13.4) setup. I think it's basically the same as this: https://github.com/nfroidure/ttf2woff2/issues/49 which indicates ttf2woff2 doesn't play nice with node 12 prior to version 3.0.

Could you bump the ttf2woff2 dependency to 3.0.0 to (hopefully) include node 12 support for fontmin-webpack?

The output of my npm install fontmin-webpack error is:

$ npm install --save-dev fontmin-webpack
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

> ttf2woff2@2.0.3 install /data/.../node_modules/fontmin-webpack/node_modules/ttf2woff2
> (node-gyp rebuild > builderror.log) || (exit 0)

../csrc/addon.cc: In function ‘Nan::NAN_METHOD_RETURN_TYPE convert(Nan::NAN_METHOD_ARGS_TYPE)’:
../csrc/addon.cc:10:49: error: no matching function for call to ‘v8::Value::ToObject()’
   Local<Object> inputBuffer = info[0]->ToObject();
                                                 ^
../csrc/addon.cc:10:49: note: candidates are:
In file included from /data/.cache/node-gyp/12.14.1/include/node/node.h:63:0,
                 from ../../../../nan/nan.h:54,
                 from ../csrc/addon.cc:1:
/data/.cache/node-gyp/12.14.1/include/node/v8.h:2576:44: note: v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^
/data/.cache/node-gyp/12.14.1/include/node/v8.h:2576:44: note:   candidate expects 1 argument, 0 provided
In file included from /data/.cache/node-gyp/12.14.1/include/node/v8-internal.h:14:0,
                 from /data/.cache/node-gyp/12.14.1/include/node/v8.h:25,
                 from /data/.cache/node-gyp/12.14.1/include/node/node.h:63,
                 from ../../../../nan/nan.h:54,
                 from ../csrc/addon.cc:1:
/data/.cache/node-gyp/12.14.1/include/node/v8.h:2590:31: note: v8::Local<v8::Object> v8::Value::ToObject(v8::Isolate*) const
                 Local<Object> ToObject(Isolate* isolate) const);
                               ^
/data/.cache/node-gyp/12.14.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
/data/.cache/node-gyp/12.14.1/include/node/v8.h:2590:31: note:   candidate expects 1 argument, 0 provided
                 Local<Object> ToObject(Isolate* isolate) const);
                               ^
/data/.cache/node-gyp/12.14.1/include/node/v8config.h:311:3: note: in definition of macro ‘V8_DEPRECATED’
   declarator __attribute__((deprecated(message)))
   ^
make: *** [Release/obj.target/addon/csrc/addon.o] Error 1
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:223:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Linux 3.10.0-1062.1.1.el7.x86_64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /data/node_modules/fontmin-webpack/node_modules/ttf2woff2
gyp ERR! node -v v12.14.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
patrickhulce commented 4 years ago

Thanks for letting me know @blueskies79! We'll add node 12 to our build matrix too

patrickhulce commented 4 years ago

2.0.6 was just published with ttf2woff2 3.0.0 as dependency