LeoBorai opened issue #12224:
Hi folks, I'm writing a solution to run WASM files using wasmtime, I use WIT to define a
handlerfunction 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 usingget_typed_func::<(String,), (Result<String, String>,)>and runs it.The name used for the function is the following:
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 exportI have tried with different names:
- Skipping package name:
api#handler- Using function name directly:
handlerBut 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
LeoBorai commented on issue #12224:
Hi folks! I've resolved the issue was on my side.
Using
wasm-toolsmade debugging the output far easier.Thanks so much and HNY!
LeoBorai closed issue #12224:
Hi folks, I'm writing a solution to run WASM files using wasmtime, I use WIT to define a
handlerfunction 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 usingget_typed_func::<(String,), (Result<String, String>,)>and runs it.The name used for the function is the following:
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 exportI have tried with different names:
- Skipping package name:
api#handler- Using function name directly:
handlerBut 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