{"record":{"id":"d4a847285acd65c6","repo":"bevyengine/bevy","slug":"missing-relationship-target-x-attribute","errorCode":null,"errorMessage":"Missing `relationship_target = X` attribute","messagePattern":"Missing `relationship_target = X` attribute","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/bevy_ecs/macro_logic/src/component.rs","lineNumber":755,"sourceCode":"        while !input.is_empty() {\n            let lookahead = input.lookahead1();\n            if lookahead.peek(kw::allow_self_referential) {\n                input.parse::<kw::allow_self_referential>()?;\n                allow_self_referential = true;\n            } else if lookahead.peek(kw::relationship_target) {\n                input.parse::<kw::relationship_target>()?;\n                input.parse::<Token![=]>()?;\n                relationship_target = Some(input.parse()?);\n            } else {\n                return Err(lookahead.error());\n            }\n            if !input.is_empty() {\n                input.parse::<Token![,]>()?;\n            }\n        }\n        Ok(Relationship {\n            relationship_target: relationship_target.ok_or_else(|| {\n                syn::Error::new(input.span(), \"Missing `relationship_target = X` attribute\")\n            })?,\n            allow_self_referential,\n        })\n    }\n}\n\nimpl Parse for RelationshipTarget {\n    fn parse(input: syn::parse::ParseStream) -> Result<Self> {\n        let mut relationship: Option<Type> = None;\n        let mut linked_spawn: bool = false;\n\n        while !input.is_empty() {\n            let lookahead = input.lookahead1();\n            if lookahead.peek(kw::linked_spawn) {\n                input.parse::<kw::linked_spawn>()?;\n                linked_spawn = true;\n            } else if lookahead.peek(kw::relationship) {\n                input.parse::<kw::relationship>()?;","sourceCodeStart":737,"sourceCodeEnd":773,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_ecs/macro_logic/src/component.rs#L737-L773","documentation":"Compile error from parsing #[relationship_target] attribute options in the Relationship derive macro: the parser saw the `relationship_target` keyword but failed to consume the required `= X` (target relationship type) part, or an unrecognized token followed it. The lookahead1 error is a generic sentinel for a malformed attribute token stream at that position.","triggerScenarios":"Thrown at crates/bevy_ecs/macro_logic/src/component.rs:755 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Write the attribute as #[relationship_target = RelationshipType] with a literal `=` and a valid type path","Ensure no stray tokens or typos (e.g. missing comma between attribute options like relationship_target = X, relationship_verified) follow the value","Separate multiple options with commas: #[relationship_target = Child, relationship_verified)]"],"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"}