{"record":{"id":"f9445ef905fee3a8","repo":"emberjs/ember.js","slug":"invalid-block-parameters-syntax-mustaches-cannot","errorCode":null,"errorMessage":"Invalid block parameters syntax: mustaches cannot be used inside parameters list","messagePattern":"Invalid block parameters syntax: mustaches cannot be used inside parameters list","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts","lineNumber":406,"sourceCode":"        } else {\n          // \" as {{...\", \" as bs...\", \" as =...\", \" as ...\", \" as/>...\"\n          // Don't consume, let the normal tokenizer code handle the next steps\n          state = { state: 'Done' };\n        }\n      },\n\n      BeforeBlockParamName: (next: string) => {\n        assert(state.state === 'BeforeBlockParamName', 'bug in block params parser');\n\n        if (isSpace(next)) {\n          this.tokenizer.consume();\n        } else if (next === '') {\n          // The HTML tokenizer ran out of characters, so we are either\n          // encountering mustache or <EOF>\n          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            );","sourceCodeStart":388,"sourceCodeEnd":424,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts#L388-L424","documentation":"While the parser is inside a block parameters list (`as |...|`), a mustache (`{{...}}`) cannot legally appear; block params are plain identifiers only. When the HTML tokenizer encounters a mustache in that state, the parser throws this error at the mustache's location.","triggerScenarios":"mustache() handler firing while parsePossibleBlockParams is active and the parser is mid-parameters-list — e.g. `<Foo as |a {{b}}|>` or `<Foo as |{{x}}|>`.","commonSituations":"Trying to interpolate a dynamic name into block params; typos like `<Foo as |a|{{b}}>` where the pipe list was left unclosed before a mustache.","solutions":["Use plain identifiers only inside the pipes; bind values via the yielded block, not mustaches","Close the parameters list with `|` before any mustache expression"],"exampleFix":"// before\n<Foo as |a {{b}}|>{{a}}</Foo>\n// after\n<Foo as |a|>{{a}} {{b}}</Foo>","handlingStrategy":"validation","validationCode":"// Block param lists may only contain identifiers\nif (/<[^>]*\\bas\\s\\|[^|]*\\{\\{/.test(template)) {\n  throw new Error('Mustaches are not allowed inside a block params list');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only plain identifiers belong inside `as |...|`","Close the params list with `|>` before starting mustache content"],"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"}