diff --git a/crates/environ/src/component/translate.rs b/crates/environ/src/component/translate.rs index f0542e1ec0..f4ebc98492 100644 --- a/crates/environ/src/component/translate.rs +++ b/crates/environ/src/component/translate.rs @@ -603,6 +603,16 @@ impl<'a, 'data> Translator<'a, 'data> { self.validator.component_export_section(&s)?; for export in s { let export = export?; + + // TODO: https://github.com/bytecodealliance/wasmtime/issues/4494 + // Currently, wit-component-based tooling creates components that + // export types to represent the interface of a component so that + // bindings can (potentially) be generated directly from the component + // itself without a wit file. For now, we ignore these exports in Wasmtime. + if wasmparser::ComponentExternalKind::Type == export.kind { + continue; + } + let item = self.kind_to_item(export.kind, export.index); let prev = self.result.exports.insert(export.name, item); assert!(prev.is_none()); diff --git a/tests/misc_testsuite/component-model/instance.wast b/tests/misc_testsuite/component-model/instance.wast index 3d68d272c7..74e5270122 100644 --- a/tests/misc_testsuite/component-model/instance.wast +++ b/tests/misc_testsuite/component-model/instance.wast @@ -67,6 +67,12 @@ )) ) +;; Test to see if a component with a type export can be instantiated. +(component + (type string) + (export "" (type 0)) +) + ;; double-check the start function runs by ensuring that a trap shows up and it ;; sees the wrong value for the global import (assert_trap