comlink-loader
comlink-loader copied to clipboard
Using WASM modules in Comlink-ed Webworker
For my project I have a WASM (Rust based) module imported as a package using wasm-pack.
In the regular (non-Web Worker) workflow the package works just fine, but when I put everything under comlink-loader things start to break and I get
_wasm_bg_wasm__WEBPACK_IMPORTED_MODULE_0__.add_two_ints is not a function
initially coming from
callback
src/comlink.ts:312
309 | break;
310 | case MessageType.APPLY:
311 | {
> 312 | returnValue = rawValue.apply(parent, argumentList);
| ^ 313 | }
314 | break;
315 | case MessageType.CONSTRUCT:
is there a good way to keep comlink-loader and fix that?
I'm running into the same problem, @sklinov did you find any workaround for this?
@outkine Sorry to write that here, but I've migrated from comlink-loader to another tool.
You can check out my boilerplate example here https://github.com/sklinov/react-wasm