{"record":{"id":"365e3bbad2b5e306","repo":"bevyengine/bevy","slug":"a-type-path-attribute-must-be-specified","errorCode":null,"errorMessage":"a #[type_path = \"...\"] attribute must be specified when using {provenance}","messagePattern":"a #\\[type_path = \"\\.\\.\\.\"\\] attribute must be specified when using (.+?)","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/bevy_reflect/derive/src/derive_data.rs","lineNumber":281,"sourceCode":"                    format!(\"cannot use `#[{TYPE_NAME_ATTRIBUTE_NAME} = \\\"...\\\"]` without a `#[{TYPE_PATH_ATTRIBUTE_NAME} = \\\"...\\\"]` attribute.\"),\n                ));\n            }\n            _ => (),\n        }\n\n        let type_path = ReflectTypePath::Internal {\n            ident: &input.ident,\n            custom_path,\n            generics: &input.generics,\n        };\n\n        let meta = ReflectMeta::new(type_path, container_attributes);\n\n        if provenance.source == ReflectImplSource::ImplRemoteType\n            && meta.type_path_attrs().should_auto_derive()\n            && !meta.type_path().has_custom_path()\n        {\n            return Err(syn::Error::new(\n                meta.type_path().span(),\n                format!(\"a #[{TYPE_PATH_ATTRIBUTE_NAME} = \\\"...\\\"] attribute must be specified when using {provenance}\"),\n            ));\n        }\n\n        #[cfg(feature = \"reflect_documentation\")]\n        let meta = meta.with_docs(doc);\n\n        if meta.attrs().is_opaque() {\n            return Ok(Self::Opaque(meta));\n        }\n\n        match &input.data {\n            Data::Struct(data) => {\n                let fields = Self::collect_struct_fields(&data.fields)?;\n                let serialization_data =\n                    SerializationDataDef::new(&fields, &meta.bevy_reflect_path)?;\n                let reflect_struct = ReflectStruct {","sourceCodeStart":263,"sourceCodeEnd":299,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_reflect/derive/src/derive_data.rs#L263-L299","documentation":"Compile-time error from the Reflect derive macro (impl_remote_type provenance): when deriving reflect impls for a remote type, a #[type_path = \"...\"] attribute is mandatory because the macro cannot infer the type's path. Add the attribute specifying the remote type's full path.","triggerScenarios":"Thrown at crates/bevy_reflect/derive/src/derive_data.rs:281 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add the required #[type_path = \"...\"] attribute to the type","Use a provenance that does not require a custom type path"],"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"}