{"record":{"id":"3377b44cbf17ca75","repo":"BoundaryML/baml","slug":"unknown-axis-name","errorCode":null,"errorMessage":"unknown axis `{name}`","messagePattern":"unknown axis `(.+?)`","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_type_macros/src/parse.rs","lineNumber":301,"sourceCode":"    /// Whether the variant carries a `TyAttr` (a named `attr` field or a\n    /// trailing tuple `TyAttr`). Attr-less template leaves get accessor\n    /// fallbacks instead of a compile error.\n    pub(crate) has_attr: bool,\n}\n\nimpl Family {\n    pub(crate) fn from_input(input: FamilyInput) -> syn::Result<Self> {\n        let FamilyInput {\n            axes,\n            members,\n            satellites,\n            master,\n        } = input;\n\n        let axis_index = |name: &Ident| -> syn::Result<usize> {\n            axes.iter()\n                .position(|a| a == name)\n                .ok_or_else(|| syn::Error::new(name.span(), format!(\"unknown axis `{name}`\")))\n        };\n        let member_index = |name: &Ident| -> syn::Result<usize> {\n            members.iter().position(|m| &m.name == name).ok_or_else(|| {\n                syn::Error::new(name.span(), format!(\"unknown family member `{name}`\"))\n            })\n        };\n\n        let master_ident = master.ident.clone();\n\n        let resolved_members = members\n            .iter()\n            .enumerate()\n            .map(|(i, m)| {\n                let includes = m\n                    .includes\n                    .iter()\n                    .map(&axis_index)\n                    .collect::<syn::Result<Vec<_>>>()?;","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_type_macros/src/parse.rs#L283-L319","documentation":"In the baml_type_macros derive/attribute parser (from_input), macro inputs referencing an axis are resolved by name against the declared axes list. If an ident doesn't match any declared axis, a syn::Error with a span on that ident is emitted at compile time.","triggerScenarios":"Expanding the macro with input that names an axis not present in the axes declaration — a misspelled axis name or referencing an axis removed from the family definition.","commonSituations":"Typos in macro invocations (e.g. 'modality' vs 'modalities'); refactoring axis names without updating all macro call sites; copy-pasting macro usage from another family.","solutions":["Fix the axis name in the macro invocation to match a declared axis exactly","Check the family definition for the correct spelling of available axes","If the axis was renamed in a refactor, update all macro call sites to the new name"],"exampleFix":"// before\naxis: modality,\n\n// after\naxis: modalities,","handlingStrategy":"type-guard","validationCode":null,"typeGuard":"fn known_axis(name: &str, axes: &[&str]) -> Option<usize> {\n    axes.iter().position(|a| a == name)\n}","tryCatchPattern":"// Compile-time error; fix the source. To surface a friendlier message in build scripts:\nmatch known_axis(\"modality\", &axes) {\n    Some(_) => {}\n    None => panic!(\"axis `modality` not declared; available: {axes:?}\"),\n}","preventionTips":["Reference axis names by copy-pasting from the family definition","Run cargo check immediately after renaming axes to catch stale call sites","Keep macro invocations adjacent to the family definition for reviewability"],"tags":["proc-macro","rust","compile-time"],"backgroundTag":"invalid-identifier-format","analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}