DioxusLabs/dioxus · error
unexpected extra argument
Error message
unexpected extra argument
What it means
While parsing `#[server]` macro options, this fires when an extra argument remains that matches none of the known option keys or supported positional forms — typically a misspelled keyword like `nam = "x"`. The unrecognized argument is rejected at compile time.
Solutions
- Remove the extra argument; the macro does not accept any further arguments at this position.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at packages/fullstack-macro/src/lib.rs:1703 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/05fa6872631e9cdc.
Report an issue: GitHub.
Appendix: source
Thrown at packages/fullstack-macro/src/lib.rs:1703
} else {
return Err(syn::Error::new(value.span(), "expected string literal"));
}
}
} else if lookahead.peek(LitStr) {
if use_key_and_value {
return Err(syn::Error::new(
stream.span(),
"If you use keyword arguments (e.g., `name` = \
Something), then you can no longer use arguments \
without a keyword.",
));
}
match arg_pos {
1 => return Err(lookahead.error()),
2 => prefix = Some(stream.parse()?),
3 => encoding = Some(stream.parse()?),
4 => fn_path = Some(stream.parse()?),
_ => return Err(syn::Error::new(stream.span(), "unexpected extra argument")),
}
} else {
return Err(lookahead.error());
}
if !stream.is_empty() {
stream.parse::<Token![,]>()?;
}
}
// Now parse any remaining extractors (key: Type pattern)
while !stream.is_empty() {
if stream.peek(Ident) && stream.peek2(Token![:]) {
server_args.push_value(stream.parse::<FnArg>()?);
if stream.peek(Comma) {
server_args.push_punct(stream.parse::<Comma>()?);
} else {
break;View on GitHub (pinned to 24f6a829df)