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

Worker Threads: "Module did not self-register" #66

Closed
mattolson opened this issue Oct 24, 2018 · 1 comment
Closed

Worker Threads: "Module did not self-register" #66

mattolson opened this issue Oct 24, 2018 · 1 comment

Comments

@mattolson
Copy link

When using the new experimental worker threads in Node 10.5 and above, if you require lzma-native in both the parent and the worker, the following error is thrown:

Error: Module did not self-register.
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:718:18)
    at Module.load (internal/modules/cjs/loader.js:599:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
    at Function.Module._load (internal/modules/cjs/loader.js:530:3)
    at Module.require (internal/modules/cjs/loader.js:637:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at /Users/matt.olson/workspace/storefront-renderer/node_modules/lzma-native/index.js:13:14
    at Object.<anonymous> (/Users/matt.olson/workspace/storefront-renderer/node_modules/lzma-native/index.js:597:3)
    at Module._compile (internal/modules/cjs/loader.js:689:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)

This seems to be related to nodejs/node#21783 and nodejs/node#21481. I believe the issue is that the module needs to be context-aware.

I ran into a similar issue with the lzo package and have a PR open for it. We will need to do something similar here.

@addaleax
Copy link
Owner

addaleax commented Jan 2, 2020

This should work now.

@addaleax addaleax closed this as completed Jan 2, 2020
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

2 participants