emberjs/ember.js · error

Invalid block parameters syntax: expecting the tag to be clo

Error message

Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list

What it means

When the template reaches end-of-file while the parser is still inside a block parameters list, it cannot complete the tag, so it throws this error spanning from the `as` to EOF. The parameters list was never closed and the tag never terminated with `>` or `/>`.

Source

Thrown at packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts:412

      BeforeBlockParamName: (next: string) => {
        assert(state.state === 'BeforeBlockParamName', 'bug in block params parser');

        if (isSpace(next)) {
          this.tokenizer.consume();
        } else if (next === '') {
          // The HTML tokenizer ran out of characters, so we are either
          // encountering mustache or <EOF>
          state = { state: 'Done' };
          this.pendingError = {
            mustache(loc: src.SourceSpan) {
              throw generateSyntaxError(
                `Invalid block parameters syntax: mustaches cannot be used inside parameters list`,
                loc
              );
            },
            eof(loc: src.SourceOffset) {
              throw generateSyntaxError(
                `Invalid block parameters syntax: expecting the tag to be closed with ">" or "/>" after parameters list`,
                as.start.until(loc)
              );
            },
          };
        } else if (next === '|') {
          if (element.params.length === 0) {
            // Following Handlebars and treat empty block params a syntax error
            throw generateSyntaxError(
              `Invalid block parameters syntax: empty parameters list, expecting at least one identifier`,
              as.start.until(this.offset().move(1))
            );
          } else {
            state = { state: 'AfterEndPipe' };
            this.tokenizer.consume();
          }
        } else if (next === '>' || next === '/') {
          throw generateSyntaxError(

View on GitHub (pinned to 26f97246a8)

Solutions

  1. Close the parameters list and tag: `<Foo as |a b|>` or `<Foo as |a b|/>`
  2. Check the template file was saved/complete and not truncated

Example fix

// before
<Foo as |a b
// after
<Foo as |a b|>{{a}}</Foo>
Defensive patterns

Strategy: validation

Validate before calling

// Check template completeness: balanced pipes inside tag opens and a closing `>`
const opens = template.match(/<[^>]*\bas\s\|[^>]*$/);
if (opens) throw new Error('Tag with block params is unterminated at EOF');

Prevention

When it happens

Trigger: eof() handler invoked while parsePossibleBlockParams is pending — templates truncated inside the params list, e.g. `<Foo as |a b` with no closing pipe or tag close.

Common situations: Truncated template files (failed saves, partial pastes); heredocs or string templates cut off; editors deleting trailing lines.

Related errors


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