I have been searching on the internet and found some old plugins that was able to use Web Workers. But when I tried to run it myself, I got error of Worker is not a constructor.
Is this feature deprecated? Or this is not available at all? I would love to be able to host WASM-based code in a web worker so it doesn’t block the UI when it is running.
Hey @joethei , This is the plugin I am trying and the web worker example plugin is not working.
Meanwhile I am building my own plugin wanting to put Transformers.js into the plugin, and it is using WASM via onnxruntime-web. Since running neural net models are very compute intensive, I had to turn on the worker builds, and it is not working. For now I reverted to a branch that is working but not using web workers, it will halt the entire UI for a few seconds when the inferenceSession is running.
@joethei I finally arrived in the Worker is not a constructor error. Using Webpack to build this time (pnpm webpack in the project) and it gives me the following error: