When I am running a worker file inside a nodeJs application in a loop it gives error as :
Module did not self-register: '/server/node_modules/onnxruntime-node/bin/napi-v3/linux/x64/onnxruntime_binding.node'.
Here is my code:
const MyPomise = await new Promise((resolve, reject) => {
const worker = new Worker("../server/workers/create.js", {
workerData: { MessageList: listToSend }
});
worker.on("message", resolve);
worker.on("error", reject);
});
const Data = await MyPomise;
Note: Above code is running worker file for the first time but giving error when running this in loop or requesting to run on second request in controller file.
MyPromiseis not a Promise, as you already await it.