Fails when using WASM-based libraries
I am trying to use this plugin in a vite-based project, where I am running a worker that uses a wasm-based library. I can successfully use the library with standard imports into the project, but when I attempt to load the library within the web worker, it stalls, even if the library itself isn't used. I have created a sandbox that shows this behavior. A couple other notes:
- In the worker.js file, the library is being imported. Commenting this out should allow the App.jsx to retrieve the result of the add function and display it (instead of null).
- The other stuff in App.jsx just confirms that the wasm-based library is indeed functioning within the non-webworker environment.
- I tried fiddling with the ordering of the various plugins, but couldn't get anything to work with that.
Is this something that is a limitation of the library, or could it be a configuration issue somewhere? Thanks!
Thanks for reporting. Quick guess: is your lib running the wasm inside a webworker? Than it might be problematic.
Will digg into it later will take some time...
Thanks for the reply. It isn't running a webworker as far as I know, but I may be mistaken. The lib itself is generated through wasm-bindgen and wasm-pack using their bundler target (link). I inquired with them about any limitations this may have but so far haven't heard back.
might be fixed with v5 please try it and if it doesn't work reopen this issue.