{"record":{"id":"5c1782040fac4ea8","repo":"emberjs/ember.js","slug":"using-a-handlebars-comment-when-in-the-tokenize","errorCode":null,"errorMessage":"Using a Handlebars comment when in the `${tokenizer['state']}` state is not supported","messagePattern":"Using a Handlebars comment when in the `(.+?)` state is not supported","errorType":"validation","errorClass":"SyntaxError","httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/parser/handlebars-node-visitors.ts","lineNumber":351,"sourceCode":"      return null;\n    }\n\n    const { value, loc } = rawComment;\n    const comment = b.mustacheComment({ value, loc: this.source.spanFor(loc) });\n\n    switch (tokenizer.state) {\n      case 'beforeAttributeName':\n      case 'afterAttributeName':\n        this.currentStartTag.comments.push(comment);\n        break;\n\n      case 'beforeData':\n      case 'data':\n        appendChild(this.currentElement(), comment);\n        break;\n\n      default:\n        throw generateSyntaxError(\n          `Using a Handlebars comment when in the \\`${tokenizer['state']}\\` state is not supported`,\n          this.source.spanFor(rawComment.loc)\n        );\n    }\n\n    return comment;\n  }\n\n  PartialStatement(partial: HBS.PartialStatement): never {\n    throw generateSyntaxError(\n      `Handlebars partials are not supported`,\n      this.source.spanFor(partial.loc)\n    );\n  }\n\n  PartialBlockStatement(partialBlock: HBS.PartialBlockStatement): never {\n    throw generateSyntaxError(\n      `Handlebars partial blocks are not supported`,","sourceCodeStart":333,"sourceCodeEnd":369,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/parser/handlebars-node-visitors.ts#L333-L369","documentation":"Error \"Using a Handlebars comment when in the `${tokenizer['state']}` state is not supported\" thrown in emberjs/ember.js.","triggerScenarios":"Thrown at packages/@glimmer/syntax/lib/parser/handlebars-node-visitors.ts:351 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":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}