{"record":{"id":"d8c7de37f2381576","repo":"emberjs/ember.js","slug":"name-chars-is-not-a-valid-named-block-and-n","errorCode":null,"errorMessage":"<:${name.chars}> is not a valid named block, and named blocks must begin with a lowercase letter","messagePattern":"<:(.+?)> is not a valid named block, and named blocks must begin with a lowercase letter","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/v2/normalize.ts","lineNumber":946,"sourceCode":"  }\n\n  assertNamedBlock(name: SourceSlice, table: BlockSymbolTable): ASTv2.NamedBlock {\n    if (this.el.base.selfClosing) {\n      throw generateSyntaxError(\n        `<:${name.chars}/> is not a valid named block: named blocks cannot be self-closing`,\n        this.loc\n      );\n    }\n\n    if (isPresentArray(this.namedBlocks)) {\n      throw generateSyntaxError(\n        `Unexpected named block inside <:${name.chars}> named block: named blocks cannot contain nested named blocks`,\n        this.loc\n      );\n    }\n\n    if (!isLowerCase(name.chars)) {\n      throw generateSyntaxError(\n        `<:${name.chars}> is not a valid named block, and named blocks must begin with a lowercase letter`,\n        this.loc\n      );\n    }\n\n    if (\n      this.el.base.attrs.length > 0 ||\n      this.el.base.componentArgs.length > 0 ||\n      this.el.base.modifiers.length > 0\n    ) {\n      throw generateSyntaxError(\n        `named block <:${name.chars}> cannot have attributes, arguments, or modifiers`,\n        this.loc\n      );\n    }\n\n    let offsets = SpanList.range(this.nonBlockChildren, this.loc);\n","sourceCodeStart":928,"sourceCodeEnd":964,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/v2/normalize.ts#L928-L964","documentation":"Named block names must begin with a lowercase letter (they are analogous to arguments/yield names, not components). assertNamedBlock throws when the name inside `<:Name>` starts with an uppercase character (or otherwise fails the lowercase check).","triggerScenarios":"Compiling a template containing `<:Header>...</:Header>` with an uppercase-first block name.","commonSituations":"Pascal-casing by habit from component names; editors auto-capitalizing block names; team conventions mismatch with Glimmer's named-block rules.","solutions":["Rename the block to start with a lowercase letter: `<:header>...</:header>`.","Update the corresponding `{{yield to=\"header\"}}` call in the component to match the lowercase name.","Update any `has-block(\"header\")` checks to the lowercase name."],"exampleFix":"// before\n<Card><:Header>Title</:Header></Card>\n\n// after\n<Card><:header>Title</:header></Card>","handlingStrategy":"validation","validationCode":"// Enforce lowercase-first named block names.\nfunction assertNamedBlockNameValid(name) {\n  if (!/^[a-z]/.test(name)) {\n    throw new Error(`<:${name}> must begin with a lowercase letter`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Name named blocks in camelCase/lowercase, never PascalCase.","Keep `{{yield to=\"name\"}}` and `has-block(\"name\")` strings consistent with block names.","Add an ember-template-lint rule or code review check for block naming."],"tags":["glimmer","template-compiler","named-blocks","naming"],"backgroundTag":"invalid-named-block-usage","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}