Skip to content

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

@lmarcelocc

Description

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions