Compiling verifier v0.1.0 (/home/ubunutu/workspace/verifier)
Finisheddevprofile [unoptimized + debuginfo] target(s) in 0.80s
Creating component target/wasm32-wasip1/debug/verifier.wasm
error: failed to decode world from moduleCaused by:
0: module was not valid
1: failed to resolve importenv::getpid
2: module requires an import interface namedenv
Hi, I'm encountering this error when using cargo component build to build my project to a wasm component. Even though this error happened, the wasm file target/wasm32-wasip1/debug/verifier.wasm is generated, but instead of component it is a wasm module. Also, I don't find any reference of env::getpid in my project(maybe some Rust lib uses it). Why is this kind of dependency error happening at build time?
Here is my world.wit:
package test:verifier@0.1.0;
interface verifier-itf {
variant optional-data {
value(list<u8>),
not-provided,
}
type report-data = optional-data;
type init-data-hash = optional-data;
resource verifier {
evaluate: func(
evidence: list<u8>,
expected-report-data: report-data,
expected-init-data-hash: init-data-hash
) -> string;
}
}
world verifier-wrd {
export verifier-itf;
}
Last updated: Dec 06 2025 at 06:05 UTC