DioxusLabs/dioxus · error · syn::Error

Illegal setting - field is already ${already}

Error message

Illegal setting - field is already ${already}

What it means

Guard in FieldInfo::apply_meta (builder attribute parsing): a field received a second conflicting builder attribute (e.g. two of default/optional/strip_option or a flag already set by `extend` handling). The faulting input is the duplicate #[props(...)] flag on the same field; remove one of the conflicting attributes.

Source

Thrown at packages/core-macro/src/props/mod.rs:431

                                    .unwrap(),
                            );
                            self.strip_option = true;
                            Ok(())
                        }

                        "extend" => {
                            self.extends.push(path.path);
                            Ok(())
                        }

                        _ => {
                            macro_rules! handle_fields {
                                ( $( $flag:expr, $field:ident, $already:expr; )* ) => {
                                    match name.as_str() {
                                        $(
                                            $flag => {
                                                if self.$field {
                                                    Err(Error::new(path.span(), concat!("Illegal setting - field is already ", $already)))
                                                } else {
                                                    self.$field = true;
                                                    Ok(())
                                                }
                                            }
                                        )*
                                        _ => Err(Error::new_spanned(
                                                &path,
                                                format!("Unknown setter parameter {:?}", name),
                                        ))
                                    }
                                }
                            }
                            handle_fields!(
                                "skip", skip, "skipped";
                                "into", auto_into, "calling into() on the argument";
                                "displayable", from_displayable, "calling to_string() on the argument";
                                "strip_option", strip_option, "putting the argument in Some(...)";

View on GitHub (pinned to 24f6a829df)

Solutions

  1. Remove the duplicate or conflicting field attribute; the field already has the indicated setting applied, so keep only one of them.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/core-macro/src/props/mod.rs:431 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/ae72bd440b85aa17. Report an issue: GitHub.