Skip to content

libc++abi: terminating with uncaught exception of type Napi::Error #980

@olalonde

Description

@olalonde

I'm getting a very weird and difficult to reproduce bug...

The process exits with this:

libc++abi: terminating with uncaught exception of type Napi::Error

It happens when I forgot await the compare() promise, e.g.:

async function assertPasswordMatches(plaintextPassword: string, hash: string) {
  const matches = /* oops forgot await */ bcrypt.compare(plaintextPassword, hash);
  if (!matches) {
    throw new AuthError();
  }
}

The bug happens when I running a test using vitest. I tried to reproduce in the node.bcrypt.js test files but didn't manage to. :/

bcrypt 5.1.0
node v18.8.0
MacOS M1

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