DioxusLabs/dioxus · error · syn::Error

Unsupported reference type

Error message

Unsupported reference type

What it means

Error "Unsupported reference type" thrown in DioxusLabs/dioxus.

Source

Thrown at packages/manganis/manganis-macro/src/ffi.rs:119

                        _ => {
                            // Assume it's an opaque type reference
                            return Ok(ForeignType::OpaqueRef(segment.ident.clone()));
                        }
                    }
                }
                Err(syn::Error::new(ty.span(), "Unsupported type path"))
            }
            Type::Reference(type_ref) => {
                if let Type::Path(path) = &*type_ref.elem {
                    if path.path.is_ident("str") {
                        return Ok(ForeignType::StrRef);
                    }
                    // Check for &OpaqueType
                    if path.path.segments.len() == 1 {
                        return Ok(ForeignType::OpaqueRef(path.path.segments[0].ident.clone()));
                    }
                }
                Err(syn::Error::new(ty.span(), "Unsupported reference type"))
            }
            Type::Tuple(tuple) if tuple.elems.is_empty() => Ok(ForeignType::Unit),
            _ => Err(syn::Error::new(ty.span(), "Unsupported type")),
        }
    }

    /// Get the JNI signature for this type
    fn jni_signature(&self) -> String {
        match self {
            ForeignType::Bool => "Z".into(),
            ForeignType::I8 => "B".into(),
            ForeignType::I16 => "S".into(),
            ForeignType::I32 => "I".into(),
            ForeignType::I64 => "J".into(),
            ForeignType::U8 => "B".into(), // JNI doesn't have unsigned, use signed
            ForeignType::U16 => "S".into(),
            ForeignType::U32 => "I".into(),
            ForeignType::U64 => "J".into(),

View on GitHub (pinned to 393d190a80)

When it happens

Trigger: Thrown at packages/manganis/manganis-macro/src/ffi.rs:119 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of DioxusLabs/dioxus@393d190a80 (2026-08-16). Data as JSON: /api/errors/2003fa0b65c0adf1. Report an issue: GitHub.