Stream: git-wasmtime

Topic: wasmtime / issue #12714 wasmtime serve fails to link wasi...


view this post on Zulip Wasmtime GitHub notifications bot (Mar 04 2026 at 01:38):

mizchi opened issue #12714:

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

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

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.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 04 2026 at 15:37):

alexcrichton commented on issue #12714:

WASIp3 is disabled by default, so if you pass -Sp3 does that resolve this error?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2026 at 08:37):

TheRayquaza commented on issue #12714:

Hello :wave:
I am having a similar issue with wasmtime 43.0.0 (be23469ec 2026-03-20)

wasmtime serve \
  --addr 127.0.0.1:3000 \
  -W component-model-async=y \
  -O pooling-allocator=n \
  -S cli=y \
  -S inherit-network=y \
  -S tcp=y \
  -S allow-ip-name-lookup=y -Sp3 \
  ./my_module.wasm

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 `fields` has the wrong type
    1: resource implementation is missing

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2026 at 08:39):

TheRayquaza edited a comment on issue #12714:

Hello :wave:
I am having a similar issue with wasmtime 43.0.0 (be23469ec 2026-03-20)

wasmtime serve \
  --addr 127.0.0.1:3000 \
  -W component-model-async=y \
  -O pooling-allocator=n \
  -S cli=y \
  -S inherit-network=y \
  -S tcp=y \
  -S allow-ip-name-lookup=y -Sp3 \
  ./my_module.wasm

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 `fields` has the wrong type
    1: resource implementation is missing

Any idea where that could come from ? Should I downgrade the wasi:http/types@0.3.0 version ?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 24 2026 at 08:39):

TheRayquaza edited a comment on issue #12714:

Hello :wave:
I am having a similar issue with wasmtime 43.0.0 (be23469ec 2026-03-20)

wasmtime serve \
  --addr 127.0.0.1:3000 \
  -W component-model-async=y \
  -O pooling-allocator=n \
  -S cli=y \
  -S inherit-network=y \
  -S tcp=y \
  -S allow-ip-name-lookup=y -Sp3 \
  ./my_module.wasm

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 `fields` has the wrong type
    1: resource implementation is missing

Any idea where that could come from ?

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 16:25):

alexcrichton closed issue #12714:

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

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

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.

view this post on Zulip Wasmtime GitHub notifications bot (Mar 30 2026 at 16:25):

alexcrichton commented on issue #12714:

@TheRayquaza with Wasmtime 43 you'll need to use the 2026-03-15 snapshot of WASI, so you'll need to figure out which dependency is pulling in the January version and update that.

Otherwise we haven't heard back on this issue, so I'm going to close it as I don't think there's an issue here to fix, or at least I'm not aware of something.


Last updated: Apr 12 2026 at 23:10 UTC