unjs / unwasm

🇼 WebAssembly tools for JavaScript
MIT License
178 stars 6 forks source link

Support web workers #36

Open danielcommesse opened 4 months ago

danielcommesse commented 4 months ago

Environment

macOS Firefox & Chrome node v22.1.0 npm 10.7.0 vite v5.3.3

Reproduction

Not available.

Describe the bug

I am using this library https://github.com/antelle/argon2-browser, and I managed to use it without troubles through unwasm, however I recently tried to load it within a web worker, and it doesn't work, basically, it loads the library as an object, but with functions as strings. I've tried a lot of things and can't get it to work within a web worker.

In the description of the package it is not clear how to use it within a web worker.

I am not sure if this is actually a bug.

Any help would be appreciated.

Additional context

No response

Logs

No response

pi0 commented 4 months ago

Hi. Web targets (also worker/server-workers) are not supported yet by unwasm but it is on the plan.