{"record":{"id":"4f1ff1eff0049fc1","repo":"bevyengine/bevy","slug":"duplicate-required-components-are-not-allowed","errorCode":null,"errorMessage":"Duplicate required components are not allowed.","messagePattern":"Duplicate required components are not allowed\\.","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/macro_logic/src/component.rs","lineNumber":142,"sourceCode":"                        attrs.summary_tick = true;\n                        Ok(())\n                    } else if nested.path.is_ident(CLONE_BEHAVIOR) {\n                        attrs.clone_behavior = Some(nested.value()?.parse()?);\n                        Ok(())\n                    } else if nested.path.is_ident(MAP_ENTITIES) {\n                        attrs.map_entities =\n                            Some(nested.input.parse::<MapEntitiesAttributeKind>()?);\n                        Ok(())\n                    } else {\n                        Err(nested.error(\"Unsupported attribute\"))\n                    }\n                })?;\n            } else if attr.path().is_ident(REQUIRE) {\n                let punctuated =\n                    attr.parse_args_with(Punctuated::<Require, Comma>::parse_terminated)?;\n                for require in punctuated.iter() {\n                    if !require_paths.insert(require.path.to_token_stream().to_string()) {\n                        return Err(syn::Error::new(\n                            require.path.span(),\n                            \"Duplicate required components are not allowed.\",\n                        ));\n                    }\n                }\n                if let Some(current) = &mut attrs.requires {\n                    current.extend(punctuated);\n                } else {\n                    attrs.requires = Some(punctuated);\n                }\n            } else if attr.path().is_ident(RELATIONSHIP) {\n                let relationship = attr.parse_args::<Relationship>()?;\n                attrs.relationship = Some(relationship);\n            } else if attr.path().is_ident(RELATIONSHIP_TARGET) {\n                let relationship_target = attr.parse_args::<RelationshipTarget>()?;\n                attrs.relationship_target = Some(relationship_target);\n            }\n        }","sourceCodeStart":124,"sourceCodeEnd":160,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/macro_logic/src/component.rs#L124-L160","documentation":"Compile-time error from ComponentAttributes::parse: the #[require(...)] list on a component contains the same required component more than once. The derive rejects duplicates because required component sets must be unique for deterministic initialization.","triggerScenarios":"Thrown at crates/bevy_ecs/macro_logic/src/component.rs:142 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the duplicate entry from the #[require(...)] attribute","Check for requirements re-exported under different paths that resolve to the same component"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"396ca727080776bd313bb892423b7d94e03b81b4","analyzedAt":"2026-08-20T16:12:39.808Z","contentChangedAt":"2026-08-20T16:12:39.808Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}