DioxusLabs/dioxus · error

`encoding` and `input` should not both be specified

Error message

`encoding` and `input` should not both be specified

What it means

While parsing `#[server]` macro options, this fires when both `encoding` and `input` keywords are present. They are mutually exclusive ways to define the request body type, so specifying both is a compile error; pick one.

Solutions

  1. Specify only one of `encoding` or `input`; they are mutually exclusive ways of describing the request body.
Defensive patterns

Strategy: validation

When it happens

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

Appendix: source

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

                    } else if key == "encoding" {
                        if encoding.is_some() {
                            return Err(syn::Error::new(
                                key.span(),
                                "keyword argument repeated: `encoding`",
                            ));
                        }
                        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`",
                            ));
                        }

View on GitHub (pinned to 24f6a829df)