Stream: jco

Topic: Is this is a jco, wasm-tools or another thing?


view this post on Zulip Elmer Bulthuis (Jul 05 2025 at 20:19):

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!

view this post on Zulip Notification Bot (Jul 05 2025 at 20:19):

Elmer Bulthuis has marked this topic as resolved.

view this post on Zulip Notification Bot (Jul 05 2025 at 20:45):

Elmer Bulthuis has marked this topic as unresolved.

view this post on Zulip Elmer Bulthuis (Jul 05 2025 at 20:53):

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