ehh seems that this is not a jco / wasm-tools bug, as I have nog been able to reproduce it. So this topic can be closed I guess!
Sorry for the noise!
Elmer Bulthuis has marked this topic as resolved.
Elmer Bulthuis has marked this topic as unresolved.
It's kindof funky but I was able to reproduce now, I have this wit file:
package luvdasun:hoi;
interface imports {
greet: async func() -> string;
}
interface exports {
greet: async func() -> string;
}
world hoi {
export exports;
import imports;
}
Now the thing compiles if I just return "Hoi" as an implementation, like this:
use exports::luvdasun::hoi::exports::Guest;
wit_bindgen::generate!({
world: "hoi",
path: "../../../wit"
});
export!(Host);
pub struct Host {}
impl Guest for Host {
async fn greet() -> String {
std::future::ready("Hoi".into()).await
}
}
But when i do this I get the error
use exports::luvdasun::hoi::exports::Guest;
use crate::luvdasun::hoi::imports;
wit_bindgen::generate!({
world: "hoi",
path: "../../../wit"
});
export!(Host);
pub struct Host {}
impl Guest for Host {
async fn greet() -> String {
imports::greet().await
}
}
results in:
(jco transpile) ComponentError: failed to extract interface information from component
Caused by:
type mismatch for export `0` of module instantiation argument ``
expected: (func (param i32) (result i32))
found: (func (param i32 i32) (result i32)) (at offset 0xbd22)
Any ideas?
Last updated: Dec 06 2025 at 06:05 UTC