DioxusLabs/dioxus · error · syn::Error
keyword argument repeated: `input`
Error message
keyword argument repeated: `input`
What it means
The `input = ...` key (input codec for a `#[server]` function) may be specified at most once. A second `input` occurrence — or one following `encoding` — is rejected (packages/fullstack-macro/src/lib.rs:1595-1600).
Source
Thrown at packages/fullstack-macro/src/lib.rs:1596
}
encoding = Some(stream.parse()?);
} else if key == "endpoint" {
if fn_path.is_some() {
return Err(syn::Error::new(
key.span(),
"keyword argument repeated: `endpoint`",
));
}
fn_path = Some(stream.parse()?);
} else if key == "input" {
if encoding.is_some() {
return Err(syn::Error::new(
key.span(),
"`encoding` and `input` should not both be \
specified",
));
} else if input.is_some() {
return Err(syn::Error::new(
key.span(),
"keyword argument repeated: `input`",
));
}
input = Some(stream.parse()?);
} else if key == "input_derive" {
if input_derive.is_some() {
return Err(syn::Error::new(
key.span(),
"keyword argument repeated: `input_derive`",
));
}
input_derive = Some(stream.parse()?);
} else if key == "output" {
if encoding.is_some() {
return Err(syn::Error::new(
key.span(),
"`encoding` and `output` should not both be \View on GitHub (pinned to 393d190a80)
Solutions
- Keep a single `input = ...` entry.
- If layering is needed (compression, custom formats), implement one custom codec type implementing the codec traits and reference it once.
- Lint attributes for duplicate keys after automated edits.
Example fix
// before
#[server(input = Json, input = Multipart)]
async fn upload(file: Vec<u8>) { ... }
// after
#[server(input = Multipart)]
async fn upload(file: Vec<u8>) { ... } Defensive patterns
Strategy: validation
Validate before calling
# Reuse the duplicate-key checker from index 93; input is in its key list.
Prevention
- One input key per function; custom layering goes into a single custom codec type.
- Let rustfmt/rust-analyzer format attributes so duplicates are visually obvious in diffs.
When it happens
Trigger: `#[server(input = Json, input = Multipart)]`; copy-paste duplication; attempting to layer codecs (e.g. compressed JSON) by listing `input` twice.
Common situations: Refactors that append rather than replace attribute args; merge conflicts; scaffolding templates that already include an `input` key.
Related errors
- keyword argument repeated: `encoding`
- `encoding` and `input` should not both be specified
- keyword argument repeated: `name`
- keyword argument repeated: `prefix`
- keyword argument repeated: `endpoint`
AI-assisted analysis of DioxusLabs/dioxus@393d190a80 (2026-08-16).
Data as JSON: /api/errors/540d250427a3876f.
Report an issue: GitHub.