{"record":{"id":"087b5adf22c9f8cd","repo":"bevyengine/bevy","slug":"cannot-use-type-name-without-a-typ","errorCode":null,"errorMessage":"cannot use `#[type_name = \"...\"]` without a `#[type_path = \"...\"]` attribute.","messagePattern":"cannot use `#\\[type_name = \"\\.\\.\\.\"\\]` without a `#\\[type_path = \"\\.\\.\\.\"\\]` attribute\\.","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"crates/bevy_reflect/derive/src/derive_data.rs","lineNumber":261,"sourceCode":"                Meta::NameValue(pair) if pair.path.is_ident(\"doc\") => {\n                    if let syn::Expr::Lit(syn::ExprLit {\n                        lit: syn::Lit::Str(lit),\n                        ..\n                    }) = &pair.value\n                    {\n                        doc.push(lit.value());\n                    }\n                }\n                _ => continue,\n            }\n        }\n        match (&mut custom_path, custom_type_name) {\n            (Some(path), custom_type_name) => {\n                let ident = custom_type_name.unwrap_or_else(|| input.ident.clone());\n                path.segments.push(PathSegment::from(ident));\n            }\n            (None, Some(name)) => {\n                return Err(syn::Error::new(\n                    name.span(),\n                    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()","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/bevyengine/bevy/blob/396ca727080776bd313bb892423b7d94e03b81b4/crates/bevy_reflect/derive/src/derive_data.rs#L243-L279","documentation":"Compile-time error from the Reflect derive macro: a #[type_name = \"...\"] attribute appeared without the required #[type_path = \"...\"] attribute. type_name only customizes the final identifier, so a type_path must accompany it; add the type_path attribute or remove type_name.","triggerScenarios":"Thrown at crates/bevy_reflect/derive/src/derive_data.rs:261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a #[type_path = \"...\"] attribute alongside #[type_name]","Remove the #[type_name] attribute if a custom name is not needed"],"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"}