lukaslueg / macro_railroad_ext

Display syntax-diagrams for Rust-macros on docs.rs and doc.rust-lang.org
MIT License
185 stars 10 forks source link

RuntimeError: unreachable executed as soon as extension is loaded #8

Open BafDyce opened 2 years ago

BafDyce commented 2 years ago

I create the extension with make packed.zip but when I load it in my browser and open a site on which it should be executed, I get the following error:

RuntimeError: unreachable executed macro_railroad_ext.js line 36 > WebAssembly.compile:1667270:1

System information:

I think it has to do with calling the DOM api or something. For example, the following code does not result in this error:

#[cfg_attr(cargo_web, js_export)]
pub fn load() {
    let x = 1+1;

    /*if let Err(err) = priv_load() {
        stdweb::console!(error, format!("{:?}", err))
    }*/
}

However, the following results in the error:

#[cfg_attr(cargo_web, js_export)]
pub fn load() {
    let x = 1+1;
    stdweb::console!(error, "asdf");

    /*if let Err(err) = priv_load() {
        stdweb::console!(error, format!("{:?}", err))
    }*/
}