arbourd opened issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.wasi:io/pollis already imported byadd_to_linker_async.
define_unknown_imports_as_trapsshould skip already-imported instances, but it appears not to (within a component, not a function):Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) (import "unknown-func" (func)) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command succeeds.
Actual Results
Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
arbourd added the bug label to Issue #13896.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.wasi:io/pollis already imported byadd_to_linker_async.
define_unknown_imports_as_trapsshould skip already-imported instances, but it appears not to (within a component?):Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) (import "unknown-func" (func)) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command succeeds.
Actual Results
Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.wasi:io/pollis already imported byadd_to_linker_async.
define_unknown_imports_as_trapsshould skip already-imported instances, but it appears not to (within a component?):Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command succeeds.
Actual Results
Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.wasi:io/pollis already imported byadd_to_linker_async.
define_unknown_imports_as_trapsshould skip already-imported instances, but it appears not to (within a component?):Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command succeeds.
Actual Results
Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced in a private repo.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.wasi:io/pollis already imported byadd_to_linker_async.
define_unknown_imports_as_trapsshould skip already-imported instances, but it appears not to (within a component?):Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: `wasi:io/poll@0.2.12` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced in a private repo.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.wasi:io/pollis already imported byadd_to_linker_async.
define_unknown_imports_as_trapsshould skip already-imported instances, but it appears not to (within a component?):Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced in a private repo.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.wasi:io/pollis already imported byadd_to_linker_async.
define_unknown_imports_as_trapsshould skip already-imported instances, but it appears not to (within a component?):Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced with a Rust project.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example. I think a Rust test could show the issue if this doesn't.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.wasi:io/pollis already imported by add_to_linker_async.
define_unknown_imports_as_trapsshould skip already-imported instances, but it appears not to (within a component?):Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced with a Rust project.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example. I think a Rust test could show the issue if this doesn't.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.wasi:io/pollis already imported via the call to add_to_linker_async.
define_unknown_imports_as_trapsshould skip already-imported instances, but it appears not to (within a component?):Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced with a Rust project.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example. I think a Rust test could show the issue if this doesn't.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.
wasi:io/pollis already imported via the call to add_to_linker_async.define_unknown_imports_as_traps should skip already-imported instances, but it appears not to.
This example code is similar to where I experienced the error:
fn example(component: &[u8]) -> anyhow::Result<()> { let engine = Engine::default(); // assume component imports `wasi:io/poll let component = Component::new(engine, component)?; // panics linker.define_unknown_imports_as_traps(&component)?; Ok(()) }Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced with a Rust project.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example. I think a Rust test could show the issue if this doesn't.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.
wasi:io/pollis already imported via the call to add_to_linker_async.define_unknown_imports_as_traps should skip already-imported instances, but it appears not to.
This example code is similar to where I experienced the error:
fn example(component: &Component) -> anyhow::Result<()> { let engine = Engine::default(); // assume component imports `wasi:io/poll let component = Component::new(engine, component)?; // panics linker.define_unknown_imports_as_traps(&component)?; Ok(()) }Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced with a Rust project.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example. I think a Rust test could show the issue if this doesn't.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.
wasi:io/pollis already imported via the call to add_to_linker_async.define_unknown_imports_as_traps should skip already-imported instances, but it appears not to.
This example code is similar to where I experienced the error:
async fn example(component: &[u8]) -> anyhow::Result<()> { let engine = Engine::default(); let mut linker: component::Linker<()> = component::Linker::new(&engine); // assume component imports `wasi:io/poll let component = Component::new(&engine, component)?; // panics linker.define_unknown_imports_as_traps(&component)?; Ok(()) }Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced with a Rust project.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example. I think a Rust test could show the issue if this doesn't.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.
wasi:io/pollis already imported via the call to add_to_linker_async.define_unknown_imports_as_traps should skip already-imported instances, but it appears not to.
This example code is similar to where I experienced the error:
async fn example(component: &[u8]) -> anyhow::Result<()> { let engine = Engine::default(); let mut linker: component::Linker<()> = component::Linker::new(&engine); wasmtime_wasi::p2::add_to_linker_async(&mut linker)?; // assume component imports `wasi:io/poll let component = Component::new(&engine, component)?; // panics linker.define_unknown_imports_as_traps(&component)?; Ok(()) }Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced with a Rust project.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example. I think a Rust test could show the issue if this doesn't.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.
wasi:io/pollis already imported via the call to add_to_linker_async.define_unknown_imports_as_traps should skip already-imported instances, but it appears not to.
This example code is similar to where I experienced the error:
async fn example(component: &[u8]) -> anyhow::Result<()> { let engine = Engine::default(); let mut linker: component::Linker<()> = component::Linker::new(&engine); wasmtime_wasi::p2::add_to_linker_async(&mut linker)?; // assume component imports `wasi:io/poll let component = Component::new(&engine, component)?; // errors linker.define_unknown_imports_as_traps(&component)?; Ok(()) }Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the
wasmtime_wasi::add_to_linker_asyncerror I experienced with a Rust project.I hope it captures the problem I've experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example. I think a Rust test could show the issue if this doesn't.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.
wasi:io/pollis already imported via the call to add_to_linker_async.define_unknown_imports_as_traps should skip already-imported instances, but it appears not to.
This example code is similar to where I experienced the error:
async fn example(component: &[u8]) -> anyhow::Result<()> { let engine = Engine::default(); let mut linker: component::Linker<()> = component::Linker::new(&engine); wasmtime_wasi::p2::add_to_linker_async(&mut linker)?; // assume component imports `wasi:io/poll let component = Component::new(&engine, component)?; // errors linker.define_unknown_imports_as_traps(&component)?; Ok(()) }Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the error I experienced in Rust.
I hope it captures the problem I experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example.
arbourd edited issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.
wasi:io/pollis already imported via the call to add_to_linker_async.define_unknown_imports_as_traps should skip already-imported instances, but it appears not to.
This example code is similar to where I experienced the error:
async fn example(component: &[u8]) -> anyhow::Result<()> { let engine = Engine::default(); let mut linker: component::Linker<()> = component::Linker::new(&engine); wasmtime_wasi::p2::add_to_linker_async(&mut linker)?; // assume component imports `wasi:io/poll` let component = Component::new(&engine, component)?; // errors linker.define_unknown_imports_as_traps(&component)?; Ok(()) }Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the error I experienced in Rust.
I hope it captures the problem I experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example.
alexcrichton commented on issue #13896:
Thanks for the report! This'll get fixed by https://github.com/bytecodealliance/wasmtime/pull/13908
alexcrichton closed issue #13896:
I ran into this issue with a component that was importing
wasi:io/poll@0.2.12.
wasi:io/pollis already imported via the call to add_to_linker_async.define_unknown_imports_as_traps should skip already-imported instances, but it appears not to.
This example code is similar to where I experienced the error:
async fn example(component: &[u8]) -> anyhow::Result<()> { let engine = Engine::default(); let mut linker: component::Linker<()> = component::Linker::new(&engine); wasmtime_wasi::p2::add_to_linker_async(&mut linker)?; // assume component imports `wasi:io/poll` let component = Component::new(&engine, component)?; // errors linker.define_unknown_imports_as_traps(&component)?; Ok(()) }Test Case
example.wat(component (import "wasi:io/poll@0.2.12" (instance (export "pollable" (type (sub resource))) )) )Steps to Reproduce
wasmtime run -W unknown-imports-trap example.watExpected Results
The command fails with
no exported instance named.Error: failed to run main module `example.wat` Caused by: no exported instance named `wasi:io/poll@0.2.12`Actual Results
The command fails with a
defined twice.Error: failed to run main module `example.wat` Caused by: map entry `wasi:io/poll@0.2.12` defined twiceVersions and Environment
Wasmtime version or commit: wasmtime 46.0.1 (823d1b8f2 2026-06-24)
Operating system: macOS 26.5.2
Architecture: arm64
Extra Info
The naive example above is an attempt to recreate the error I experienced in Rust.
I hope it captures the problem I experienced and isn't a distraction. If it doesn't make sense, I can attempt to provide a better example.
Last updated: Jul 29 2026 at 05:03 UTC