smol-rs / async-compat

Compatibility adapter between tokio and futures
Apache License 2.0
156 stars 12 forks source link

Wasm error #28

Closed cBournhonesque closed 9 months ago

cBournhonesque commented 9 months ago

Hi, I am developing a bevy game, which uses async-executor under the hood as its runtime. I need to interact with TCP or webtransport, and both crates use the tokio runtime.

I've been able to use the tokio runtime without issue, but i'd like to avoid using it since the rest of bevy relies on smol.

I was able to replace my IO-related tasks to use Compat::new() and it seemed to work perfectly. It works well in native, but when I tried to connect to the server in wasm I get the error:

Error(JsValue(RangeError: supplied view is not large enough.

I'm not entirely sure what this could be due to? The only thing I recall changing is adding Compat::new

notgull commented 9 months ago

Do you have a minimum reproducing example?

cBournhonesque commented 9 months ago

I think it was actually due to something unrelated; sorry about that!

Thanks for this amazing crate, I'm still a beginner with async and this has been super helpful