{"record":{"id":"c40e72c2f29df16f","repo":"emberjs/ember.js","slug":"invalid-named-block-named-detected-you-may-have-c","errorCode":null,"errorMessage":"Invalid named block named detected, you may have created a named block without a name, or you may have began your name with a number. Named blocks must have names that are at least one character long, and begin with a lower case letter","messagePattern":"Invalid named block named detected, you may have created a named block without a name, or you may have began your name with a number\\. Named blocks must have names that are at least one character long, and begin with a lower case letter","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts","lineNumber":117,"sourceCode":"    };\n  }\n\n  beginEndTag(): void {\n    this.currentNode = {\n      type: 'EndTag',\n      name: '',\n      start: this.source.offsetFor(this.tagOpenLine, this.tagOpenColumn),\n    };\n  }\n\n  finishTag(): void {\n    let tag = this.finish<StartTag | EndTag>(this.currentTag);\n\n    if (tag.type === 'StartTag') {\n      this.finishStartTag();\n\n      if (tag.name === ':') {\n        throw generateSyntaxError(\n          'Invalid named block named detected, you may have created a named block without a name, or you may have began your name with a number. Named blocks must have names that are at least one character long, and begin with a lower case letter',\n          this.source.spanFor({\n            start: this.currentTag.start.toJSON(),\n            end: this.offset().toJSON(),\n          })\n        );\n      }\n\n      if (voidMap.has(tag.name) || tag.selfClosing) {\n        this.finishEndTag(true);\n      }\n    } else {\n      // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- exhaustive\n      assert(tag.type === 'EndTag', `Invalid tag type ${tag.type}`);\n      this.finishEndTag(false);\n    }\n  }\n","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts#L99-L135","documentation":"Glimmer's tokenizer supports named blocks with the syntax <:name> ... </:name>. When finishTag sees a StartTag named exactly ':' it means the named-block name is missing or invalid (e.g. you wrote <:> or <:123> leaving an empty-name tag), so it throws with guidance: names must be at least one character and begin with a lowercase letter.","triggerScenarios":"Compiling a template containing a malformed named-block start tag: <:> ... </:>, <:1foo>, or a tag where the name after ':' was stripped/empty so tag.name === ':' when finishTag (tokenizer-event-handlers) finalizes the StartTag.","commonSituations":"Early/experimental use of Glimmer named blocks with typos; template codemods that mangle <:yield> style tags; editor auto-completion inserting the colon-prefixed tag without the name; copying syntax from other frameworks (Vue slots, Angular ng-content).","solutions":["Name the block with a valid lowercase identifier: <:> → <:default> or <:header> ... </:header>.","Ensure the name begins with a lowercase letter (not a digit): <:1item> → <:item1>.","Verify matching start/end tags and that your toolchain version actually supports named blocks before relying on the syntax."],"exampleFix":"// before\n<:>\n  content\n</:>\n\n// after\n<:header>\n  content\n</:header>","handlingStrategy":"validation","validationCode":"// validate named-block tags before compiling\nfunction assertValidNamedBlocks(template) {\n  const bad = template.match(/<:\\s*>|<:\\s*\\d[^>]*>/g);\n  if (bad) throw new Error(`Invalid named block(s): ${bad.join(', ')}; name must start with a-z`);\n}\nassertValidNamedBlocks(template);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always give named blocks a lowercase-letter name: <:header>","Never leave the name empty after ':' in a named-block tag","Confirm your Glimmer/Ember version supports named blocks before using the syntax","Add matching start/end tags and verify them with a template linter"],"tags":["glimmer","handlebars","template-syntax","named-blocks"],"backgroundTag":"glimmer-invalid-named-block","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}