{"record":{"id":"f7bc7643f599f56a","repo":"vectordotdev/vector","slug":"component-names-may-only-contain-ascii-characters","errorCode":null,"errorMessage":"component names may only contain ASCII characters","messagePattern":"component names may only contain ASCII characters","errorType":"validation","errorClass":"syn::Error","httpStatus":null,"severity":"error","filePath":"lib/vector-config-macros/src/component_name.rs","lineNumber":155,"sourceCode":"            ),\n        ));\n    }\n\n    // Now try and parse the helper attribute as a literal string, which is the only valid form.\n    // After that, make sure it's actually valid according to our naming rules.\n    attr.parse_args::<LitStr>()\n        .map_err(|_| {\n            Error::new(\n                attr.span(),\n                format!(\n                    \"expected a string literal for the {component_type} name (i.e. `{component_type_attr}(\\\"...\\\")`)\"\n                ),\n            )\n        })\n        .and_then(|component_name| {\n            let component_name_str = component_name.value();\n            check_component_name_validity(&component_name_str)\n                .map_err(|e| Error::new(component_name.span(), e))\n                .map(|()| Some(component_name_str))\n        })\n}\n\nfn check_component_name_validity(component_name: &str) -> Result<(), String> {\n    // In a nutshell, component names must contain only lowercase ASCII alphabetic characters, or\n    // numbers, or underscores.\n\n    if component_name.is_empty() {\n        return Err(\"component name must be non-empty\".to_string());\n    }\n\n    // We only support ASCII names, so get that out of the way.\n    if !component_name.is_ascii() {\n        return Err(\"component names may only contain ASCII characters\".to_string());\n    }\n\n    // Now, we blindly try and convert the given component name into the correct format, and","sourceCodeStart":137,"sourceCodeEnd":173,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/lib/vector-config-macros/src/component_name.rs#L137-L173","documentation":"Compile-time validation error from `check_component_name_validity`. After the non-empty check, `component_name.is_ascii()` is enforced because the name is embedded into generated code, JSON schemas, and documentation slugs that only handle ASCII.","triggerScenarios":"Naming a component with non-ASCII characters: `#[configurable_component(source(\"café\"))]`, `source(\"日志\")`, `sink(\"métricas\")`, or names containing typographic dashes/spaces copied from prose.","commonSituations":"Non-English teams naming components in their native language, or smart quotes/dashes pasted from a document editor replacing ASCII ones.","solutions":["Rename the component using only ASCII letters, digits, and underscores (e.g. `source(\"cafe\")`, `source(\"logs\")`)","Check for invisible Unicode (non-breaking spaces, zero-width chars) if the name looks ASCII but still fails"],"exampleFix":"// before\n#[configurable_component(source(\"café\"))]\n\n// after\n#[configurable_component(source(\"cafe\"))]","handlingStrategy":"validation","validationCode":"# CI gate: non-ASCII names fail at compile time\ncargo check --workspace --all-targets","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Restrict component names to ASCII letters, digits, underscores","Beware invisible Unicode pasted from editors/docs (smart quotes, non-breaking spaces)"],"tags":["rust","proc-macro","compile-time","unicode","vector"],"backgroundTag":"non-ascii-identifier","analyzedSha":"3708c39b12a93212ed8b8d7510b4cc7769cb5864","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}