{"record":{"id":"acce77b43f323497","repo":"emberjs/ember.js","slug":"invalid-block-parameters-syntax-empty-parameters","errorCode":null,"errorMessage":"Invalid block parameters syntax: empty parameters list, expecting at least one identifier","messagePattern":"Invalid block parameters syntax: empty parameters list, expecting at least one identifier","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts","lineNumber":421,"sourceCode":"          state = { state: 'Done' };\n          this.pendingError = {\n            mustache(loc: src.SourceSpan) {\n              throw generateSyntaxError(\n                `Invalid block parameters syntax: mustaches cannot be used inside parameters list`,\n                loc\n              );\n            },\n            eof(loc: src.SourceOffset) {\n              throw generateSyntaxError(\n                `Invalid block parameters syntax: expecting the tag to be closed with \">\" or \"/>\" after parameters list`,\n                as.start.until(loc)\n              );\n            },\n          };\n        } else if (next === '|') {\n          if (element.params.length === 0) {\n            // Following Handlebars and treat empty block params a syntax error\n            throw generateSyntaxError(\n              `Invalid block parameters syntax: empty parameters list, expecting at least one identifier`,\n              as.start.until(this.offset().move(1))\n            );\n          } else {\n            state = { state: 'AfterEndPipe' };\n            this.tokenizer.consume();\n          }\n        } else if (next === '>' || next === '/') {\n          throw generateSyntaxError(\n            `Invalid block parameters syntax: incomplete parameters list, expecting \"|\" but the tag was closed prematurely`,\n            as.start.until(this.offset().move(1))\n          );\n        } else {\n          // slurp up anything else into the name, validate later\n          state = {\n            state: 'BlockParamName',\n            name: next,\n            start: this.offset(),","sourceCodeStart":403,"sourceCodeEnd":439,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts#L403-L439","documentation":"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.","triggerScenarios":"parsePossibleBlockParams (via appendToAttributeName) when the next character is `|` and element.params.length === 0 — templates like `<Foo as ||>`.","commonSituations":"Writing `as ||` as a placeholder intending to add params later; mechanically deleting a param but leaving both pipes.","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>`"],"exampleFix":"// before\n<Foo as ||>\n// after\n<Foo as |item|>","handlingStrategy":"validation","validationCode":"// Reject empty block param lists\nif (/<[^>]*\\bas\\s\\|\\s*\\|/.test(template)) {\n  throw new Error('Empty block params list; expected at least one identifier');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Remove `as | |` entirely when no params are needed","Code-review templates for placeholder empty params"],"tags":["glimmer","handlebars","template-syntax","block-params"],"backgroundTag":"invalid-block-params-syntax","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}