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" #10 #50

Closed
sheunglaili opened this issue Aug 26, 2021 · 6 comments
Closed

Worker Threads: "Module did not self-register" #10 #50

sheunglaili opened this issue Aug 26, 2021 · 6 comments

Comments

@sheunglaili
Copy link

When required in worker threads, It throws error "Module did not self-register"

I think this may be related to this issue
nodejs/node#21783 (comment)
https://github.com/schroffl/node-lzo/pull/11/files

@dturing
Copy link
Owner

dturing commented Aug 27, 2021

I've modified module initialization to use NODE_MODULE_INITIALIZER, which should make the module context-aware (1c946bf). I dont think gstreamer-superficial uses any global state, so i hope that has no side effects and the module now works well with worker threads. A quick test looked ok.

use version 1.7.1 from npm or later.
thanks for reporting.

@dturing dturing closed this as completed Aug 27, 2021
@sheunglaili
Copy link
Author

Thank you so much !

@mariusrak
Copy link

I have this one-liner

new require('gstreamer-superficial').Pipeline('gst-launch-1.0 -v videotestsrc ! autovideosink').play()

and I get same error

module.js:681
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: Module did not self-register.
    at Object.Module._extensions..node (module.js:681:18)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/ubuntu/nodegst/index.js:1:75)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)

Why?

It's on jetson nano with ubuntu

@dturing
Copy link
Owner

dturing commented Oct 14, 2023

can you still reproduce this, @mariusrak ?

because i can't; your one-liner doesnt work for me for a number of reasons (the "new" initialization doesnt work, the "gst-launch-1.0" is too much in the pipeline, and the script will quit right away).

do you still see the "Module did not self-register" issue?

@mariusrak
Copy link

Hi. This error somehow relates to nodejs version and package location. I'm not sure how, but when all the installation is correct and also the version of nodejs is correct, it seems that it works. But it seems to be fragile. However, I guess we can consider this closed.

@Xeue
Copy link

Xeue commented Oct 29, 2023

Hi all, I'm seeing this issue too in Node 20.8.1 running electron 27.0.0. Is this an electron messing with packages thing?

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