diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 412b621d..65c5b477 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,3 +124,5 @@ jobs: ) fi fi + - name: Worker threads error + run: node bindings/node.js/worker-threads.js diff --git a/bindings/node.js/runnable.js b/bindings/node.js/runnable.js index 002ce8dc..138ad739 100644 --- a/bindings/node.js/runnable.js +++ b/bindings/node.js/runnable.js @@ -2,7 +2,7 @@ console.log("testing..."); -const blst = require("blst"); +const blst = require("./blst.node"); var msg = "assertion"; // this what we're signing var DST = "MY-DST"; // domain separation tag diff --git a/bindings/node.js/worker-threads.js b/bindings/node.js/worker-threads.js new file mode 100644 index 00000000..b0e50839 --- /dev/null +++ b/bindings/node.js/worker-threads.js @@ -0,0 +1,8 @@ +const { Worker } = require("worker_threads"); + +// Create two workers so blst.node is imported twice to trigger the error +// blst/bindings/node.js$ node worker-threads.js +// Error: Module did not self-register: 'blst/bindings/node.js/blst.node'. + +const worker1 = new Worker("./runnable.js"); +const worker2 = new Worker("./runnable.js");