{"record":{"id":"58033c8b3c052ccd","repo":"emberjs/ember.js","slug":"unexpected-named-block-inside-name-chars-nam","errorCode":null,"errorMessage":"Unexpected named block inside <:${name.chars}> named block: named blocks cannot contain nested named blocks","messagePattern":"Unexpected named block inside <:(.+?)> named block: named blocks cannot contain nested named blocks","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/v2/normalize.ts","lineNumber":939,"sourceCode":"  constructor(\n    private el: BuildElement,\n    loc: SourceSpan,\n    children: (ASTv2.ContentNode | ASTv2.NamedBlock)[],\n    block: BlockContext\n  ) {\n    super(loc, children, block);\n  }\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(","sourceCodeStart":921,"sourceCodeEnd":957,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/v2/normalize.ts#L921-L957","documentation":"Named blocks cannot be nested inside other named blocks. When normalizing children of a `<:name>` block, any nested named block triggers this error because the yielded-block structure is flat.","triggerScenarios":"Compiling a template like `<Card><:body><:inner>x</:inner></:body></Card>` — a `<:...>` block inside another `<:...>` block.","commonSituations":"Trying to group named blocks hierarchically; copy-paste nesting mistakes when composing deeply structured component APIs.","solutions":["Flatten the named blocks so each is a direct child of the component element.","Use distinct top-level named block names instead of nesting.","Extract an inner component if you need hierarchical block structure."],"exampleFix":"// before\n<Card><:body><:inner>x</:inner></:body></Card>\n\n// after\n<Card><:body>x</:body><:inner>y</:inner></Card>","handlingStrategy":"validation","validationCode":"// Named blocks must be flat, one level deep.\nfunction assertNoNestedNamedBlocks(namedBlock) {\n  if (namedBlock.children.some(c => c.type === 'named-block')) {\n    throw new Error(`Nested named block inside <:${namedBlock.name}>`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep named blocks one level deep under the component tag.","Model hierarchy with separate components rather than nested named blocks.","Use distinct names for sibling yielded sections."],"tags":["glimmer","template-compiler","named-blocks","syntax-error"],"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"}