Damus
Yuki Kishimoto · 1w
It supports WASM, are you compiling it from macOS? https://github.com/nostrdevkit/nostr/tree/master/crates/nostr#wasm32-unknown-unknown
reya profile picture
I got the dependency issues fixed. But look like async api from sdk didn't work in wasm enviroment?
```
error: future cannot be sent between threads safely
--> crates/state/src/lib.rs:307:12
|
307 | cx.background_spawn(async move {
| ^^^^^^^^^^^^^^^^ future created by async block is not `Send`
|
= help: the trait `std::marker::Send` is not implemented for `dyn futures::Future<Output = Result<nostr_sdk::prelude::Event, nostr_gossip_memory::prelude::Error>>`
note: future is not `Send` as it awaits another future which is not `Send`
--> crates/state/src/lib.rs:309:25
|
309 | let event = EventBuilder::new(Kind::Custom(5315), "")
| _________________________^
310 | | .tags(vec![
311 | | Tag::custom("param", vec!["search", &query]),
312 | | Tag::custom("param", vec!["limit", "10"]),
313 | | ])
314 | | .finalize_async(&signer)
| |________________________________________^ await occurs here on type `Pin<Box<dyn futures::Future<Output = Result<nostr_sdk::prelude::Event, nostr_gossip_memory::prelude::Error>>>>`, which is not `Send`
note: required by a bound in `background_spawn`
```
Yuki Kishimoto · 1w
Thanks, I'll fix this in the next few days