-
Notifications
You must be signed in to change notification settings - Fork 30.3k
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
requiring C++ addon modules occurs 'Error: Module did not self-register.' with Worker Threads #21481
Comments
I get the same with node-speaker, I'm on |
I'm running into this as well when using experimental workers that try to load the |
This looks to be a duplicate of #21783. It appears that the issue is due to addon initialization -- any native addons that are loaded in both the parent and worker thread (i.e. loaded more than once in the same process) need to be context aware. I was facing this issue with the node-lzo library and we fixed it in schroffl/node-lzo#11 |
Allow loading add-ons from multiple Node.js instances if they are declared context-aware; in particular, this applies to N-API addons. Also, plug a memory leak that occurred when registering N-API addons. Refs: #23319 PR-URL: #26175 Fixes: #21481 Fixes: #21783 Fixes: #25662 Fixes: #20239 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Richard Lau <[email protected]>
Allow loading add-ons from multiple Node.js instances if they are declared context-aware; in particular, this applies to N-API addons. Also, plug a memory leak that occurred when registering N-API addons. Refs: #23319 PR-URL: #26175 Fixes: #21481 Fixes: #21783 Fixes: #25662 Fixes: #20239 Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Richard Lau <[email protected]>
Issue occurs here too, |
When C++ addon was loaded twice with worker threads, error below occurs:
To reproduce, run code below with --experimental-worker flag:
When I try to require the sharp, same error occurs.
The text was updated successfully, but these errors were encountered: