Closed olalonde closed 1 year ago
Oh, it seems it had to do with vitest
's multithreading. I tried to reproduce with vitest --no-threads
and the issue is gone. Vitest uses https://github.com/tinylibs/tinypool to achieve multithreading. JavaScript doesn't support multithreading so I'm not sure what's going on here. Maybe it's not an important bug to fix.
Also getting the same issue with argon2
so likely not fixable by this package.
It's due to how we handle Isolates
inside Napi::AsyncWorkers, a fix of that is out of scope for us, something Node should fix
I'm getting a very weird and difficult to reproduce bug...
The process exits with this:
It happens when I forgot
await
the compare() promise, e.g.: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