Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Module did not self-register #82

Open
willin opened this issue Jun 7, 2021 · 4 comments
Open

Module did not self-register #82

willin opened this issue Jun 7, 2021 · 4 comments
Assignees

Comments

@willin
Copy link

willin commented Jun 7, 2021

Trace: Error: Module did not self-register: '/root/baas/fabric-baas-backend/node_modules/pkcs11js/build/Release/pkcs11.node'.
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1122:18)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/root/baas/fabric-baas-backend/node_modules/pkcs11js/index.js:5:16)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/root/baas/fabric-baas-backend/node_modules/fabric-network/node_modules/fabric-common/lib/impl/bccsp_pkcs11.js:27:18)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at Module.load (internal/modules/cjs/loader.js:928:32)
    at Function.Module._load (internal/modules/cjs/loader.js:769:14)
    at Module.require (internal/modules/cjs/loader.js:952:19)
    at require (internal/modules/cjs/helpers.js:88:18)
    at Object.<anonymous> (/root/baas/fabric-baas-backend/node_modules/fabric-network/node_modules/fabric-common/lib/User.js:12:28)
    at Module._compile (internal/modules/cjs/loader.js:1063:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
    at /root/baas/fabric-baas-backend/packages/server-synchronizer/dist/tasks/sync_orgsandpeersfromchannel.js:57:123
    at async syncOrgsAndPeersFromNetworkChannel (/root/baas/fabric-baas-backend/packages/server-synchronizer/dist/tasks/sync_orgsandpeersfromchannel.js:57:40)

in worker threads

npm rebuild no use. if i dont use threads.js it can work properly

@rmhrisk rmhrisk assigned rmhrisk and microshine and unassigned rmhrisk Jun 7, 2021
@microshine
Copy link
Contributor

I've reproduced that exception. Looking for solution how to fi it

@microshine
Copy link
Contributor

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

@lankke
Copy link

lankke commented Feb 5, 2023

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.

@lankke
Copy link

lankke commented Feb 6, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants