Stream: git-wasmtime

Topic: wasmtime / issue #12224 Function not found, failed to fin...


view this post on Zulip Wasmtime GitHub notifications bot (Dec 28 2025 at 18:07):

LeoBorai opened issue #12224:

Hi folks, I'm writing a solution to run WASM files using wasmtime, I use WIT to define a handler function which I'm expecting to call from my solution (host) through using wasmtime.

I have the following WIT definitions from the binary WASM file I've builded:

// ...
package wasi:random@0.2.6 {
  interface insecure-seed {
    insecure-seed: func() -> tuple<u64, u64>;
  }
}


package mate:runtime@0.1.0 {
  interface api {
    handler: async func(data: string) -> result<string, string>;
  }
}

The following code attempts to use the wasm_module, retrieves the function using get_typed_func::<(String,), (Result<String, String>,)> and runs it.

https://github.com/LeoBorai/mate/blob/29cd999d3190aece902d9dd79becd817c9afd639/src/runner/src/lib.rs#L46-L77

The name used for the function is the following:

https://github.com/LeoBorai/mate/blob/29cd999d3190aece902d9dd79becd817c9afd639/src/runner/src/lib.rs#L8-L10

When I try to run it I get the following error:

Error: Function 'mate:runtime@0.1.0/api#handler' not found

Caused by:
    failed to find function export

I have tried with different names:

But it fails with the same error.

Thanks in advance!

Reference Code

The whole implementation lies on this branch:

https://github.com/LeoBorai/mate/tree/1-async-wasm-execution

view this post on Zulip Wasmtime GitHub notifications bot (Dec 31 2025 at 20:23):

LeoBorai commented on issue #12224:

Hi folks! I've resolved the issue was on my side.

Using wasm-tools made debugging the output far easier.

Thanks so much and HNY!

view this post on Zulip Wasmtime GitHub notifications bot (Dec 31 2025 at 20:23):

LeoBorai closed issue #12224:

Hi folks, I'm writing a solution to run WASM files using wasmtime, I use WIT to define a handler function which I'm expecting to call from my solution (host) through using wasmtime.

I have the following WIT definitions from the binary WASM file I've builded:

// ...
package wasi:random@0.2.6 {
  interface insecure-seed {
    insecure-seed: func() -> tuple<u64, u64>;
  }
}


package mate:runtime@0.1.0 {
  interface api {
    handler: async func(data: string) -> result<string, string>;
  }
}

The following code attempts to use the wasm_module, retrieves the function using get_typed_func::<(String,), (Result<String, String>,)> and runs it.

https://github.com/LeoBorai/mate/blob/29cd999d3190aece902d9dd79becd817c9afd639/src/runner/src/lib.rs#L46-L77

The name used for the function is the following:

https://github.com/LeoBorai/mate/blob/29cd999d3190aece902d9dd79becd817c9afd639/src/runner/src/lib.rs#L8-L10

When I try to run it I get the following error:

Error: Function 'mate:runtime@0.1.0/api#handler' not found

Caused by:
    failed to find function export

I have tried with different names:

But it fails with the same error.

Thanks in advance!

Reference Code

The whole implementation lies on this branch:

https://github.com/LeoBorai/mate/tree/1-async-wasm-execution


Last updated: Jan 09 2026 at 13:15 UTC