uniffi-rs icon indicating copy to clipboard operation
uniffi-rs copied to clipboard

`error: future cannot be sent between threads safely` when trying to build for `wasm32-unknown-unknown`

Open setoelkahfi opened this issue 1 year ago • 1 comments
trafficstars

I'm trying to include a crate successfully built with uiffi-rs for Swift for wasm. I created a new crate called crate-networking-wasm and referenced the base crate_networking. When running wasm-pack build in the crate-networking-wasm I got this error:

error: future cannot be sent between threads safely
  --> /path-to-repo/lib/crate_networking/src/content.rs:17:1
   |
17 | #[export(async_runtime = "tokio")]
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ future created by async block is not `Send`
   |

Any pointers?

Related:

  • https://github.com/mozilla/uniffi-rs/issues/1622
  • https://github.com/mozilla/uniffi-rs/issues/2225

setoelkahfi avatar Sep 08 '24 20:09 setoelkahfi