loretoparisi / fasttext.js

FastText for Node.js
MIT License
192 stars 28 forks source link

This package cannot be used in node.js worker thread #37

Open Mykybo opened 1 year ago

Mykybo commented 1 year ago

because you use process.chdir() it throws error when run inside worker:

TypeError [ERR_WORKER_UNSUPPORTED_OPERATION]: process.chdir() is not supported in workers

loretoparisi commented 1 year ago

because you use process.chdir() it throws error when run inside worker:

TypeError [ERR_WORKER_UNSUPPORTED_OPERATION]: process.chdir() is not supported in workers

Correct, this can be solved by the way using the WASM version, loaded in a Web Worker. See https://github.com/loretoparisi/fasttext.js/tree/master/wasm