Skip to content

wasmtime serve fails to link wasi:http/types p3 component generated by wit-bindgen (resource implementation is missing) #12714

@mizchi

Description

@mizchi

Summary

wasmtime serve fails to link a wasi:http/service@0.3.0-rc-2026-01-06 component generated via wit-bindgen + wasm-tools component new.

The failure happens even without any compose step (wac / wasm-tools compose are not involved in this repro).

Versions

  • wasmtime: 41.0.3 (db1c043b5 2026-02-04)
  • wasm-tools: 1.245.1
  • rustc: 1.92.0
  • cargo: 1.92.0
  • wit-bindgen crate: 0.51.0

Minimal Repro

src/lib.rs:

wit_bindgen::generate!({
    inline: r#"
      package vibe:http-adapter;

      world serviceonly {
        include wasi:http/service@0.3.0-rc-2026-01-06;
      }
    "#,
    // Uses wasmtime's bundled wasi-http p3 WIT package
    path: "<wasmtime repo>/crates/wasi-http/src/p3/wit",
    world: "vibe:http-adapter/serviceonly",
    pub_export_macro: true,
    generate_all,
});

use exports::wasi::http::handler::Guest;
use wasi::http::types::{ErrorCode, Request, Response};

struct Component;

impl Guest for Component {
    async fn handle(request: Request) -> Result<Response, ErrorCode> {
        let _ = request;
        Err(ErrorCode::InternalError(None))
    }
}

export!(Component);

Build & run:

cargo build --target wasm32-unknown-unknown --release
wasm-tools component new target/wasm32-unknown-unknown/release/<crate>.wasm -o service_only.component.wasm
wasmtime serve \
  -W component-model-async=y \
  -W component-model-async-builtins=y \
  --addr 127.0.0.1:0 \
  service_only.component.wasm

Actual

wasmtime serve fails immediately:

Error: component imports instance `wasi:http/types@0.3.0-rc-2026-01-06`, but a matching implementation was not found in the linker

Caused by:
    0: instance export `request` has the wrong type
    1: resource implementation is missing

Additional Notes

  • This same error reproduces from a second path where we compose another component via wac plug, but the service-only repro above shows compose is not required.
  • wasm-tools validate --features all service_only.component.wasm succeeds.

If this behavior is expected due to stricter type matching semantics in serve, guidance on the required shape for imported wasi:http/types in generated components would help.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions