kelektiv / node.bcrypt.js

bcrypt for NodeJs
MIT License
7.38k stars 510 forks source link

Cannot use 'throw' with exceptions disabled & NAPI exception support not detected #1024

Open lmarcelocc opened 5 months ago

lmarcelocc commented 5 months ago

I'm receiving 2 different issues:

image

Both GCC_ENABLE_CPP_EXCEPTIONS and GCC_SYMBOLS_PRIVATE_EXTERN are set to YES.

I was able to workaround the issue, changing the way bcrypt throws exceptions, from what I saw here e.g.:

Napi::TypeError::New(env, "1 argument expected");
return Napi::Value();

instead of

throw Napi::TypeError::New(env, "4 arguments expected");

Tho, not the best solution.

For the NAPI Exception support not detected, for now, I just add this here:

'defines': [
      '_GNU_SOURCE',
      'NAPI_DISABLE_CPP_EXCEPTIONS',
],

Thanks in advance for you time!