Open willin opened 3 years ago
I've reproduced that exception. Looking for solution how to fi it
It throws Module did not self-register
for the next script
process.dlopen(module, path.resolve(__dirname, "../build/Release/pkcs11.node"));
process.dlopen(module, path.resolve(__dirname, "../build/Release/pkcs11.node"));
I did some experiments with HellloWorld examples (C++ addons and C++ N-API addons). These addons don't allow loading multiple times too
I came across the same error when I tried to include pkcs11js as a dependency to an Insomnia plugin I am developing.
Was there any insight into how to fix this problem? If the multi-threaded aspect is the cause, I might not be able to use this library as a dependency for my plugin.
I'm going to fork the repo and have a go at solving this issue. It doesn't seem to be a high priority issue but it would be great to have a pcks11 module that could be used in plugin development. I may have the solution for making the module context aware and therefore solving the multi-threaded issue.
in worker threads
npm rebuild no use. if i dont use threads.js it can work properly