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

WASM support #14

Open
youth95 opened this issue Mar 2, 2022 · 1 comment
Open

WASM support #14

youth95 opened this issue Mar 2, 2022 · 1 comment

Comments

@youth95
Copy link

youth95 commented Mar 2, 2022

hi, I want to use the crate in wasm. look like this:

#[wasm_bindgen]
pub fn run() {
    App::new()
        .insert_resource(Msaa { samples: 1 })
        .insert_resource(ClearColor(Color::rgb(0.4, 0.4, 0.4)))
        .add_plugins(DefaultPlugins)
        .add_plugin(GamePlugin)
        .add_plugin(ConsolePlugin)
        .insert_resource(ConsoleConfiguration {
            // override config here
            ..Default::default()
        })
        .add_console_command::<LogCommand, _, _>(log_command)
        .run();
}

but compile failed. can you help me? thank you.

Compiling bevy_console v0.3.0

error: there is no argument named `name`
  --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/commands/help.rs:39:43
   |
39 |                 let mut line = format!("  {name}{}", " ".repeat(longest_command_name - name.len()));
   |                                           ^^^^^^

error: there is no argument named `description`
  --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/commands/help.rs:45:48
   |
45 |                     line.push_str(&format!(" - {description}"));
   |                                                ^^^^^^^^^^^^^

error: there is no argument named `name`
   --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/console.rs:154:26
    |
154 |             write!(buf, "{name}");
    |                          ^^^^^^

error: there is no argument named `description`
   --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/console.rs:174:28
    |
174 |             writeln!(buf, "{description}");
    |                            ^^^^^^^^^^^^^

error: there is no argument named `name`
   --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/console.rs:193:22
    |
193 |                 "    {name} {}",
    |                      ^^^^^^

error: there is no argument named `ty`
   --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/console.rs:201:26
    |
201 |             write!(buf, "{ty}");
    |                          ^^^^

error: there is no argument named `description`
   --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/console.rs:211:41
    |
211 |                     writeln!(buf, "   - {description}");
    |                                         ^^^^^^^^^^^^^

error: there is no argument named `expected`
  --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/value.rs:64:36
   |
64 |                 "[error] expected '{expected}' but got '{received}' for arg #{}",
   |                                    ^^^^^^^^^^

error: there is no argument named `received`
  --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/value.rs:64:57
   |
64 |                 "[error] expected '{expected}' but got '{received}' for arg #{}",
   |                                                         ^^^^^^^^^^

error: there is no argument named `msg`
  --> /Users/admin/.cargo/registry/src/github.com-1ecc6299db9ec823/bevy_console-0.3.0/src/value.rs:75:63
   |
75 |             FromValueError::Custom(msg) => write!(f, "[error] {msg}"),
   |                                                               ^^^^^

error: could not compile `bevy_console` due to 10 previous errors
@makspll makspll changed the title Could not compile bevy_console due to 10 previous errors WASM support Sep 4, 2024
@makspll
Copy link
Collaborator

makspll commented Sep 4, 2024

The crate doesn't have official support for WASM yet which would be why this happens

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