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

Attempting to use from worker_thread throws "Module did not self register" #36

Closed
steveliles opened this issue Mar 3, 2023 · 0 comments · Fixed by #37
Closed

Attempting to use from worker_thread throws "Module did not self register" #36

steveliles opened this issue Mar 3, 2023 · 0 comments · Fixed by #37

Comments

@steveliles
Copy link
Contributor

I'm trying to spin up worker threads (https://nodejs.org/api/worker_threads.html) to take advantage of multiple cpu cores in a project that uses node-cypher-parser, but I get this error:

Error: Module did not self-register: '/Users/Steve/myproject/node_modules/cypher-parser/dist/release/cypher.node'.

Apparently this is to do with native add-ons having to be aware that they might be used from worker threads, and for many modules the fix is relatively simple: nodejs/node#21783 (comment)

Documentation for context-aware addons and some worker_thread specific stuff about cleaning up resources here:
https://github.com/nodejs/node/blob/main/doc/api/addons.md#context-aware-addons

I will try to fork and PR but I have not done any native before, so I'm not massively confident of success ...

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

Successfully merging a pull request may close this issue.

1 participant