You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Similar module error is launched when an async wasm is read:
Error: failed to parse WebAssembly module
Caused by:
invalid leading byte (0x9) for canonical function (at offset 0x3a8a7e)
#[tokio::main] // Requires the "macros" feature
async fn main() -> anyhow::Result<()> {
let mut config = Config::new();
config.wasm_component_model(true);
config.async_support(true); // Enable async support
let engine = Engine::new(&config)?;
//let mut linker = Linker::<MyState>::new(&engine);
let state = MyString::default();
let mut store = Store::new(&engine, state);
let linker = Linker::new(&engine);
let component = Component::from_file(&engine, "../async-string/target/wasm32-wasip2/debug/async-string.wasm")?;
let command = Command::instantiate_async(&mut store, &component, &linker).await?;
let result = command.wasi_cli_run().call_run(store);
println!("Result from WASM: {:?}", result.await);
Ok(())
}
The text was updated successfully, but these errors were encountered:
Support for the async ABI of the component model is not yet implemented in Wasmtime as it was only recently introduced in the component model. There is an open PR to implement it: #9582
Test Case
The wit file:
main.rs:
Steps to Reproduce
Expected Results
WASM executed successfully! [This is what happens when async: false and async removed from fn string_fn]
Actual Results
Error: failed to parse WebAssembly module
Caused by:
invalid leading byte (0x9) for canonical function (at offset 0x3a8a7e)
Versions and Environment
Wasmtime version or commit:
wit-bindgen = { version= "0.38.0", features = ["async"] }
wit-bindgen-rt = { version = "0.38.0", features = ["async"] }
Operating system: MacOS
Architecture: Arm
Extra Info
Here is a github with all the code:
https://github.com/profitgrowinginnovator/async-string
Similar module error is launched when an async wasm is read:
Error: failed to parse WebAssembly module
Caused by:
invalid leading byte (0x9) for canonical function (at offset 0x3a8a7e)
The text was updated successfully, but these errors were encountered: