I am trying to run a cli component using wasmtime, which has following wit file:
package foo:bar@0.1.0;
world cli {
include wasi:cli/imports@0.2.0;
import wasi:http/outgoing-handler@0.2.0;
export wasi:cli/run@0.2.0;
}
and a simple main function that makes an outbound request (I am using tinygo for it).
When I run it, I get following error:
Error: failed to run main module `main.wasm`
Caused by:
0: component imports instance `wasi:http/types@0.2.0`, but a matching implementation was not found in the linker
1: instance export `fields` has the wrong type
2: resource implementation is missing
Any pointers on what I might be missing here.
Thanks
I just tried this with rust and ran into same problem.
i found a similar comment here: https://github.com/bytecodealliance/wasi-rs/issues/87#issuecomment-2099616901
but i am trying to run a cli command that makes an outbound http request.
I tried with -Scli
and -Shttp
, but none of them helped
nevermind, found the issue. I was running wasmtime run main.wasm -Shttp
while I should have used wasmtime run -Shttp main.wasm
The position of -Shttp
mattered.
Rajat Jindal has marked this topic as resolved.
Last updated: Nov 22 2024 at 16:03 UTC