-
-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Some modules, for example argon2
can't be loaded in worker threads.
Try load.js
with the following code:
'use strict';
const { Worker } = require('worker_threads');
const argon2 = require('argon2');
console.dir({ argon2 });
new Worker('./thread.js');
and thread.js
with the following code:
'use strict';
const argon2 = require('argon2');
console.dir({ argon2 });
we will get exception:
Error: Module did not self-register.
at Object.Module._extensions..node (internal/modules/cjs/loader.js:775:18)
at Module.load (internal/modules/cjs/loader.js:626:32)
at tryModuleLoad (internal/modules/cjs/loader.js:566:12)
at Function.Module._load (internal/modules/cjs/loader.js:558:3)
at Module.require (internal/modules/cjs/loader.js:663:17)
at require (internal/modules/cjs/helpers.js:20:18)
at bindings (.../node_modules/bindings/bindings.js:112:48)
at Object.<anonymous> (.../node_modules/argon2/argon2.js:4:37)
at Module._compile (internal/modules/cjs/loader.js:734:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:745:10)
We need to find solution to use worker thread in impress. @nechaido you can assign this task to developers.