{"record":{"id":"c5a77a18a911a0ce","repo":"emberjs/ember.js","slug":"invalid-block-parameters-syntax-expecting-at-leas","errorCode":null,"errorMessage":"Invalid block parameters syntax: expecting at least one space character between \"as\" and \"|\"","messagePattern":"Invalid block parameters syntax: expecting at least one space character between \"as\" and \"\\|\"","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts","lineNumber":368,"sourceCode":"\n    const element = this.currentStartTag;\n    const as = this.currentAttr;\n\n    let state = { state: 'PossibleAs' } as State;\n\n    const handlers = {\n      PossibleAs: (next: string) => {\n        assert(state.state === 'PossibleAs', 'bug in block params parser');\n\n        if (isSpace(next)) {\n          // \" as ...\"\n          state = { state: 'BeforeStartPipe' };\n          this.tokenizer.transitionTo(AFTER_ATTRIBUTE_NAME);\n          this.tokenizer.consume();\n        } else if (next === '|') {\n          // \" as|...\"\n          // Following Handlebars and require a space between \"as\" and the pipe\n          throw generateSyntaxError(\n            `Invalid block parameters syntax: expecting at least one space character between \"as\" and \"|\"`,\n            as.start.until(this.offset().move(1))\n          );\n        } else {\n          // \" as{{...\", \" async...\", \" as=...\", \" as>...\", \" as/>...\"\n          // Don't consume, let the normal tokenizer code handle the next steps\n          state = { state: 'Done' };\n        }\n      },\n\n      BeforeStartPipe: (next: string) => {\n        assert(state.state === 'BeforeStartPipe', 'bug in block params parser');\n\n        if (isSpace(next)) {\n          this.tokenizer.consume();\n        } else if (next === '|') {\n          state = { state: 'BeforeBlockParamName' };\n          this.tokenizer.transitionTo(BEFORE_ATTRIBUTE_NAME);","sourceCodeStart":350,"sourceCodeEnd":386,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts#L350-L386","documentation":"When the parser sees `as` at the end of an attribute name and the very next character is `|` with no whitespace between them (e.g. `<Foo as|bar|>`), it throws. Following Handlebars conventions, at least one space is required between `as` and the opening pipe.","triggerScenarios":"parsePossibleBlockParams, reached via appendToAttributeName, when in the block-params state the next consumed character is `|` immediately following `as` — templates like `<Foo as|a b|>` or `<Foo as|a|>`.","commonSituations":"Compact one-line templates where the author omits the space for brevity; minifiers or hand-editors squeezing out whitespace; confusion with other languages where `as|` is acceptable.","solutions":["Insert a space between `as` and the opening pipe: `<Foo as |bar|>`"],"exampleFix":"// before\n<Foo as|bar|>{{bar}}</Foo>\n// after\n<Foo as |bar|>{{bar}}</Foo>","handlingStrategy":"validation","validationCode":"// Require a space between `as` and the opening pipe\nif (/<[^>]*as\\|/.test(template)) {\n  throw new Error('Expected space between \"as\" and \"|\"');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Standardize on `<Foo as |a b|>` formatting (add spaces around pipes)","Use a template formatter (prettier with glimmer plugin) to normalize spacing"],"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"}