DioxusLabs/dioxus · error
Unrecognized attribute, expected #[server(...)]
Error message
Unrecognized attribute, expected #[server(...)]
What it means
An unknown attribute was found on a server function signature. Only #[server(...)], #[doc], #[allow], #[deny] and similar pass-through attributes are permitted; anything else is rejected so typos don't silently change behavior.
Solutions
- Use a #[server(...)] attribute here; other attribute names are not recognized in this position.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/fullstack-macro/src/lib.rs:1896 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/a2c9a00497378fe9.
Report an issue: GitHub.
Appendix: source
Thrown at packages/fullstack-macro/src/lib.rs:1896
"Unrecognized #[server] attribute, expected \
#[server(default)] or #[server(rename = \
\"fieldName\")]",
)),
}
} else if attr.path().is_ident("doc") {
// Allow #[doc = "documentation"]
Ok(attr.clone())
} else if attr.path().is_ident("allow") {
// Allow #[allow(...)]
Ok(attr.clone())
} else if attr.path().is_ident("deny") {
// Allow #[deny(...)]
Ok(attr.clone())
} else if attr.path().is_ident("ignore") {
// Allow #[ignore]
Ok(attr.clone())
} else {
Err(Error::new(
attr.span(),
"Unrecognized attribute, expected #[server(...)]",
))
}
})
.collect::<Result<Vec<_>>>()?;
arg.attrs = vec![];
Ok(ServerFnArg {
arg,
server_fn_attributes,
})
}
}
fn type_from_ident(ident: Ident) -> Type {
let mut segments = Punctuated::new();
segments.push(PathSegment {
ident,View on GitHub (pinned to 24f6a829df)