You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Importing package in both main and worker thread will cause Error: Module did not self-register.
It will works if only main or worker thread is importing the package.
To Reproduce main.js
import { Worker } from 'worker_threads';
import ZooKeeper from 'zookeeper';
console.log('Hi from main.js!');
const worker = new Worker('./worker.js');
worker.js
import ZooKeeper from 'zookeeper';
console.log('Hi from worker.js!');
Describe the bug
Importing package in both main and worker thread will cause Error: Module did not self-register.
It will works if only main or worker thread is importing the package.
To Reproduce
main.js
worker.js
package.json
Screenshots
Desktop (please complete the following information):
Additional context
Hopefully this thread can provide some clue.
nodejs/node#21783
The text was updated successfully, but these errors were encountered: