node.bcrypt.js icon indicating copy to clipboard operation
node.bcrypt.js copied to clipboard

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

Open lmarcelocc opened this issue 2 years ago • 0 comments

  • What went wrong? Not sure if related with this package or with node-addon-api. So please, my apoligies if is not this repo.

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',
],
  • What did you expect to happen? Compile sucessfully

  • Which version of nodejs and OS? Node v18.18.2 MacBook Pro M1 - MacOS Sonoma 14.2.1 Xcode 15.2

  • If you find a bug, please write a failing test.

Thanks in advance for you time!

lmarcelocc avatar Jan 25 '24 12:01 lmarcelocc