{"record":{"id":"7aabe62451351937","repo":"emberjs/ember.js","slug":"invalid-block-parameters-syntax-modifiers-cannot","errorCode":null,"errorMessage":"Invalid block parameters syntax: modifiers cannot follow parameters list","messagePattern":"Invalid block parameters syntax: modifiers cannot follow parameters list","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts","lineNumber":505,"sourceCode":"          // slurp up anything else into the name, validate later\n          state.name += next;\n          this.tokenizer.consume();\n        }\n      },\n\n      AfterEndPipe: (next: string) => {\n        assert(state.state === 'AfterEndPipe', '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>, HBS side will attach the error\n          // to the next span\n          state = { state: 'Done' };\n          this.pendingError = {\n            mustache(loc: src.SourceSpan) {\n              throw generateSyntaxError(\n                `Invalid block parameters syntax: modifiers cannot follow 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 === '>' || next === '/') {\n          // Don't consume, let the normal tokenizer code handle the next steps\n          state = { state: 'Done' };\n        } else {\n          // Slurp up the next \"token\" for the error span\n          state = {\n            state: 'Error',","sourceCodeStart":487,"sourceCodeEnd":523,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts#L487-L523","documentation":"Glimmer's block-params lookahead parser (parsePossibleBlockParams) accepts `|a b|` after a tag name only if the tag is then closed. When a mustache (modifier, e.g. `{{action}}`) appears after the parameters list, the tokenizer's pendingError.mustache callback fires, because modifiers cannot follow a block-params list in Handlebars syntax.","triggerScenarios":"Parsing a template where a mustache/modifier follows a block params list on an element, e.g. `<div |a b| {{action}}>`; the mustache handler throws the pending error.","commonSituations":"Hand-written components mixing block params with element modifiers; refactoring `<div ... as |a b|>` style from block form onto the tag itself; misunderstanding that `as |x|` only applies in block form, not on element tags.","solutions":["Remove the block params list from the element tag; block params belong on curly block form (`{{#foo as |a b|}}`)","Remove the element modifier if block-params-like syntax was intentional elsewhere","Wrap the content in a real block or component that supports `as |...|`"],"exampleFix":"// before\n<div |a b| {{on \"click\" this.go}}>...</div>\n// after\n<div {{on \"click\" this.go}}>...</div>","handlingStrategy":"validation","validationCode":"// crude guard before parsing\nif (/^<[^>]*\\|[^>]*\\|[^>]*\\{\\{/m.test(template)) {\n  throw new Error('Block params cannot be followed by a modifier mustache on the tag');\n}","typeGuard":null,"tryCatchPattern":"try { parse(template) } catch (e) { if (/modifiers cannot follow parameters list/.test(e.message)) { /* report template location / fallback */ } else throw e; }","preventionTips":["Never put `|a b|` on element tags; use it only in curly block form `{{#x as |a b|}}`","Run a template linter (ember-template-lint) before building","Preview templates in an editor with Glimmer syntax highlighting"],"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"}