DioxusLabs/dioxus · error

keyword argument repeated: `name`

Error message

keyword argument repeated: `name`

What it means

While parsing the `#[server]` macro's option arguments, this fires when the keyword `name` is supplied more than once (e.g. `name = "X", name = "Y"`). Each option key may only appear once; the second occurrence is a compile error pointing at the repeated key.

Solutions

  1. Remove the duplicate `name` keyword argument; each keyword may only be specified once.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/fullstack-macro/src/lib.rs:1558 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/9695c661b4940401. Report an issue: GitHub.

Appendix: source

Thrown at packages/fullstack-macro/src/lib.rs:1558

            // Check if this looks like an extractor (Ident : Type)
            // If so, break out to parse extractors - they must come last
            if stream.peek(Ident) && stream.peek2(Token![:]) {
                break;
            }

            arg_pos += 1;
            let lookahead = stream.lookahead1();
            if lookahead.peek(Ident) {
                let key_or_value: Ident = stream.parse()?;

                let lookahead = stream.lookahead1();
                if lookahead.peek(Token![=]) {
                    stream.parse::<Token![=]>()?;
                    let key = key_or_value;
                    use_key_and_value = true;
                    if key == "name" {
                        if struct_name.is_some() {
                            return Err(syn::Error::new(
                                key.span(),
                                "keyword argument repeated: `name`",
                            ));
                        }
                        struct_name = Some(stream.parse()?);
                    } else if key == "prefix" {
                        if prefix.is_some() {
                            return Err(syn::Error::new(
                                key.span(),
                                "keyword argument repeated: `prefix`",
                            ));
                        }
                        prefix = Some(stream.parse()?);
                    } else if key == "encoding" {
                        if encoding.is_some() {
                            return Err(syn::Error::new(
                                key.span(),
                                "keyword argument repeated: `encoding`",

View on GitHub (pinned to 24f6a829df)