Skip to content

Using WASM modules in Comlink-ed Webworker #46

@sklinov

Description

@sklinov

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions