Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using WASM modules in Comlink-ed Webworker #46

Open
sklinov opened this issue Jan 3, 2022 · 2 comments
Open

Using WASM modules in Comlink-ed Webworker #46

sklinov opened this issue Jan 3, 2022 · 2 comments

Comments

@sklinov
Copy link

sklinov commented Jan 3, 2022

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?

@outkine
Copy link

outkine commented Jun 24, 2022

I'm running into the same problem, @sklinov did you find any workaround for this?

@sklinov
Copy link
Author

sklinov commented Jun 24, 2022

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants