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

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

Open
lmarcelocc opened this issue Jan 25, 2024 · 0 comments

Comments

@lmarcelocc
Copy link

lmarcelocc commented Jan 25, 2024

  • 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!

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

1 participant