DioxusLabs/dioxus · error · syn::Error
Expected ABI string (e.g., extern "Swift")
Error message
Expected ABI string (e.g., extern "Swift")
What it means
`parse_with_attr` errors when the extern block has no ABI name at all. FFI blocks processed by the manganis macro must declare `extern "Swift"` or `extern "Kotlin"` so the bridge generator knows the target language.
Solutions
- Provide the ABI as a string literal, e.g. extern "Swift".
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/manganis/manganis-macro/src/ffi.rs:297 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of DioxusLabs/dioxus@24f6a829df (2026-08-23).
Data as JSON: /api/errors/386e5c50d64fb6e6.
Report an issue: GitHub.
Appendix: source
Thrown at packages/manganis/manganis-macro/src/ffi.rs:297
impl FfiBridgeParser {
/// Parse the attribute and item together
pub fn parse_with_attr(attr: FfiAttribute, item: ItemForeignMod) -> syn::Result<Self> {
let source_path = attr.source_path;
// Determine the ABI
let abi = match &item.abi.name {
Some(name) => match name.value().as_str() {
"Swift" => ForeignAbi::Swift,
"Kotlin" => ForeignAbi::Kotlin,
other => {
return Err(syn::Error::new(
name.span(),
format!("Unsupported ABI: {}. Expected 'Swift' or 'Kotlin'", other),
));
}
},
None => {
return Err(syn::Error::new(
item.abi.extern_token.span,
"Expected ABI string (e.g., extern \"Swift\")",
));
}
};
let mut types = Vec::new();
let mut functions = Vec::new();
for item in &item.items {
match item {
ForeignItem::Type(ty) => {
types.push(ForeignTypeDecl {
name: ty.ident.clone(),
});
}
ForeignItem::Fn(func) => {
functions.push(ForeignFunctionDecl::from_foreign_fn(func)?);View on GitHub (pinned to 24f6a829df)