dojo
dojo copied to clipboard
Running Bevy app with wasm target leads to error when importing`torii-client`
trafficstars
Describe the bug
Bevy app will not compile when targeting wasm if torii-client is imported
To Reproduce
- Create a brand new rust binary:
cargo new {example_project} - Add bevy dependency:
cargo add bevy - Add the following in
main.rs:
use bevy::prelude::*;
fn main() {
App::new().add_plugins(DefaultPlugins).run();
}
- Add the following torii dependency and starknet core patch to the
Cargo.tomlfile:
[dependencies]
bevy = "0.14.0"
torii-client = { git = "https://github.com/dojoengine/dojo.git" }
[patch.crates-io]
starknet-core = { git = "https://github.com/kariy/starknet-rs", branch = "dojo-patch" }
- Setup necessary wasm requirements to run a bevy app on the browser
- Run bevy app in browser with :
cargo run --target wasm32-unknown-unknown
Expected behavior Compilation should not fail, and a black/gray window should show up on the browser.