Module did not self-register error
Closed this issue · 3 comments
I ran into a "Module did not self-register" when trying to require("posix-semaphore")
in a worker thread (when it was also required by the main thread).
Some searching on the issue led me to these links
nodejs/node#21783 (comment)
https://nodejs.org/api/addons.html#addons_context_aware_addons
I am not familiar with C++ addons, but it looks like using NODE_MODULE_INIT in addon.cc rather than NODE_MODULE might apply here.
I would be happy to help test the change or can work on a PR when I get the time (though logging the issue for now). Thanks
Hi @slobad123. Thanks for the report. It should be fixed in version 0.0.4, which has just been published. Let me know if that fixes it for you :)
It works! You're the best. Thanks
Haha thanks. Have a good one