DioxusLabs/dioxus · error · syn::Error
Props is not supported for enums
Error message
Props is not supported for enums
What it means
Compile-time rejection in the Props derive: enums are not a supported shape for a props type — the builder macro only generates code for fielded structs. The faulting input is the enum declaration annotated with #[derive(Props)].
Solutions
- Define props as a struct with named fields instead of an enum; the Props derive only supports structs.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/core-macro/src/props/mod.rs:66 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/37344b3354d1ef74.
Report an issue: GitHub.
Appendix: source
Thrown at packages/core-macro/src/props/mod.rs:66
#( #required_fields )*
#build_method
}
}
syn::Fields::Unnamed(_) => {
return Err(Error::new(
ast.span(),
"Props is not supported for tuple structs",
));
}
syn::Fields::Unit => {
return Err(Error::new(
ast.span(),
"Props is not supported for unit structs",
));
}
},
syn::Data::Enum(_) => {
return Err(Error::new(ast.span(), "Props is not supported for enums"));
}
syn::Data::Union(_) => {
return Err(Error::new(ast.span(), "Props is not supported for unions"));
}
};
Ok(data)
}
mod util {
use quote::ToTokens;
pub fn path_to_single_string(path: &syn::Path) -> Option<String> {
if path.leading_colon.is_some() {
return None;
}
let mut it = path.segments.iter();
let segment = it.next()?;
if it.next().is_some() {View on GitHub (pinned to 24f6a829df)