emberjs/ember.js · error
Invalid block parameters syntax: empty parameters list, expe
Error message
Invalid block parameters syntax: empty parameters list, expecting at least one identifier
What it means
An empty block parameters list (`<Foo as ||>` or `<Foo as | |>`) is rejected. Following Handlebars, at least one identifier must appear between the pipes, so the parser throws when the closing pipe is reached with no params collected.
Source
Thrown at packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts:421
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(
`Invalid block parameters syntax: incomplete parameters list, expecting "|" but the tag was closed prematurely`,
as.start.until(this.offset().move(1))
);
} else {
// slurp up anything else into the name, validate later
state = {
state: 'BlockParamName',
name: next,
start: this.offset(),View on GitHub (pinned to 26f97246a8)
Solutions
- Add at least one identifier between the pipes, e.g. `<Foo as |a|>`
- Remove the `as | |` entirely if no block params are needed: `<Foo>`
Example fix
// before <Foo as ||> // after <Foo as |item|>
Defensive patterns
Strategy: validation
Validate before calling
// Reject empty block param lists
if (/<[^>]*\bas\s\|\s*\|/.test(template)) {
throw new Error('Empty block params list; expected at least one identifier');
} Prevention
- Remove `as | |` entirely when no params are needed
- Code-review templates for placeholder empty params
When it happens
Trigger: parsePossibleBlockParams (via appendToAttributeName) when the next character is `|` and element.params.length === 0 — templates like `<Foo as ||>`.
Common situations: Writing `as ||` as a placeholder intending to add params later; mechanically deleting a param but leaving both pipes.
Related errors
- Invalid block parameters syntax: block parameters must be pr
- Invalid block parameters syntax: expecting at least one spac
- Invalid block parameters syntax: mustaches cannot be used in
- Invalid block parameters syntax: expecting the tag to be clo
- Invalid block parameters syntax: incomplete parameters list,
AI-assisted analysis of emberjs/ember.js@26f97246a8 (2026-09-01).
Data as JSON: /api/errors/acce77b43f323497.
Report an issue: GitHub.