{"record":{"id":"179a6557e5cf24d7","repo":"bevyengine/bevy","slug":"a-relationship-target-already-has-its-own-clone-be","errorCode":null,"errorMessage":"A Relationship Target already has its own clone behavior, please remove `clone_behavior = ...`","messagePattern":"A Relationship Target already has its own clone behavior, please remove `clone_behavior = \\.\\.\\.`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/macro_logic/src/component.rs","lineNumber":163,"sourceCode":"                        ));\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        }\n\n        if attrs.relationship_target.is_some() && attrs.clone_behavior.is_some() {\n            return Err(syn::Error::new(\n                attrs.clone_behavior.span(),\n                \"A Relationship Target already has its own clone behavior, please remove `clone_behavior = ...`\",\n            ));\n        }\n\n        if attrs.summary_tick && matches!(attrs.storage, Some(StorageTy::SparseSet)) {\n            return Err(syn::Error::new(\n                ast.span(),\n                \"Summary ticks are only supported for components with table storage.\",\n            ));\n        }\n\n        Ok(attrs)\n    }\n\n    /// Generates a new `Component` trait implementation from this specification.\n    ///\n    /// Note that this will add Send + Sync + 'static to the where clause","sourceCodeStart":145,"sourceCodeEnd":181,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/macro_logic/src/component.rs#L145-L181","documentation":"Compile-time error from ComponentAttributes::parse: the type derives RelationshipTarget (whose clone behavior is fixed by the derive) while also specifying #[component(clone_behavior = ...)], which would conflict with the generated relationship-target clone logic.","triggerScenarios":"Thrown at crates/bevy_ecs/macro_logic/src/component.rs:163 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the clone_behavior attribute from the RelationshipTarget derive","Implement clone behavior indirectly if truly needed, without conflicting with the derive"],"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-14T00:17:10.932Z"}