{"record":{"id":"46322c3561c5fd3e","repo":"livewire/livewire","slug":"invalid-livewire-child-tag-name-tag-names-must-on","errorCode":null,"errorMessage":"Invalid Livewire child tag name. Tag names must only contain letters, numbers, and hyphens.","messagePattern":"Invalid Livewire child tag name\\. Tag names must only contain letters, numbers, and hyphens\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/Features/SupportNestingComponents/SupportNestingComponents.php","lineNumber":102,"sourceCode":"    function getChildren() { return $this->storeGet('children', []); }\n    function setChild($key, $tag, $id) { $this->storePush('children', [$tag, $id], $key); }\n\n    static function setParentChild($parent, $key, $tag, $id) { store($parent)->push('children', [$tag, $id], $key); }\n    static function setPreviouslyRenderedChildren($component, $children) { store($component)->set('previousChildren', $children); }\n    static function hasPreviouslyRenderedChild($parent, $key) {\n        return array_key_exists($key, store($parent)->get('previousChildren', []));\n    }\n\n    static function getPreviouslyRenderedChild($parent, $key)\n    {\n        $child = store($parent)->get('previousChildren')[$key];\n\n        [$tag, $childId] = $child;\n\n        // Validate tag name - only allow valid HTML tag characters (letters, numbers, hyphens)\n        // Must start with a letter to be a valid HTML tag\n        if (! preg_match('/^[a-zA-Z][a-zA-Z0-9\\-]*$/', $tag)) {\n            throw new \\Exception('Invalid Livewire child tag name. Tag names must only contain letters, numbers, and hyphens.');\n        }\n\n        // Validate child ID format - only allow alphanumeric and hyphens\n        if (! preg_match('/^[a-zA-Z0-9\\-]+$/', $childId)) {\n            throw new \\Exception('Invalid Livewire child component ID format.');\n        }\n\n        return $child;\n    }\n\n    function keepRenderedChildren()\n    {\n        $this->storeSet('children', $this->storeGet('previousChildren'));\n    }\n\n    static function setParametersToMatchingProperties($component, $params)\n    {\n        // Assign all public component properties that have matching parameters.","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/livewire/livewire/blob/1a3fde34c5789366411c450cf4e630356f18b584/src/Features/SupportNestingComponents/SupportNestingComponents.php#L84-L120","documentation":"Error \"Invalid Livewire child tag name. Tag names must only contain letters, numbers, and hyphens.\" thrown in livewire/livewire.","triggerScenarios":"Thrown at src/Features/SupportNestingComponents/SupportNestingComponents.php:102 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1a3fde34c5789366411c450cf4e630356f18b584","analyzedAt":"2026-08-17T02:02:20.412Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}