emberjs/ember.js · error · SyntaxError

Using a Handlebars comment when in the `${tokenizer['state']

Error message

Using a Handlebars comment when in the `${tokenizer['state']}` state is not supported

What it means

Error "Using a Handlebars comment when in the `${tokenizer['state']}` state is not supported" thrown in emberjs/ember.js.

Source

Thrown at packages/@glimmer/syntax/lib/parser/handlebars-node-visitors.ts:351

      return null;
    }

    const { value, loc } = rawComment;
    const comment = b.mustacheComment({ value, loc: this.source.spanFor(loc) });

    switch (tokenizer.state) {
      case 'beforeAttributeName':
      case 'afterAttributeName':
        this.currentStartTag.comments.push(comment);
        break;

      case 'beforeData':
      case 'data':
        appendChild(this.currentElement(), comment);
        break;

      default:
        throw generateSyntaxError(
          `Using a Handlebars comment when in the \`${tokenizer['state']}\` state is not supported`,
          this.source.spanFor(rawComment.loc)
        );
    }

    return comment;
  }

  PartialStatement(partial: HBS.PartialStatement): never {
    throw generateSyntaxError(
      `Handlebars partials are not supported`,
      this.source.spanFor(partial.loc)
    );
  }

  PartialBlockStatement(partialBlock: HBS.PartialBlockStatement): never {
    throw generateSyntaxError(
      `Handlebars partial blocks are not supported`,

View on GitHub (pinned to 26f97246a8)

When it happens

Trigger: Thrown at packages/@glimmer/syntax/lib/parser/handlebars-node-visitors.ts:351 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of emberjs/ember.js@26f97246a8 (2026-09-01). Data as JSON: /api/errors/5c1782040fac4ea8. Report an issue: GitHub.