{"record":{"id":"660dab34f7520687","repo":"emberjs/ember.js","slug":"state-message","errorCode":null,"errorMessage":"${state.message}","messagePattern":"\\$\\{state\\.message\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts","lineNumber":536,"sourceCode":"          // 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',\n            message:\n              'Invalid block parameters syntax: expecting the tag to be closed with \">\" or \"/>\" after parameters list',\n            start: this.offset(),\n          };\n          this.tokenizer.consume();\n        }\n      },\n\n      Error: (next: string) => {\n        assert(state.state === 'Error', 'bug in block params parser');\n\n        if (next === '' || next === '/' || next === '>' || isSpace(next)) {\n          throw generateSyntaxError(state.message, state.start.until(this.offset()));\n        } else {\n          // Slurp up the next \"token\" for the error span\n          this.tokenizer.consume();\n        }\n      },\n\n      Done: () => {\n        assert(false, 'This should never be called');\n      },\n    } as const satisfies {\n      [S in keyof States]: Handler;\n    };\n\n    let next: string;\n\n    do {\n      next = this.tokenizer.peek();\n      handlers[state.state](next);","sourceCodeStart":518,"sourceCodeEnd":554,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/parser/tokenizer-event-handlers.ts#L518-L554","documentation":"While parsing a possible block params list, the parser entered the Error state with a message; if the next character terminates the tag (space, `/`, `>`, or EOF), the accumulated error is thrown with a span covering the bad token. This surfaces whatever specific failure occurred while scanning the `|...|` region (e.g. malformed param names).","triggerScenarios":"Calling appendToAttributeName / tag parsing when the text after `|` in a would-be block params list is invalid and immediately followed by a tag-terminating character, e.g. `<div |a b|>` where the list itself failed to parse.","commonSituations":"Malformed block params like `|a-b!|`, stray `|` characters in attribute areas, hand-edited templates with typos inside the pipes.","solutions":["Read the interpolated state.message for the specific parse problem","Fix the token(s) inside the `| ... |` region indicated by the error span","Remove the pipes if you didn't intend block params"],"exampleFix":"// before\n<div |a b!|>...</div>\n// after\n<div |a b|>...</div>","handlingStrategy":"try-catch","validationCode":"// validate block params region contains only identifier-ish tokens\nconst params = template.match(/\\|([^|]*)\\|/);\nif (params && !/^[\\s$\\w]+$/.test(params[1])) {\n  throw new Error('Invalid token inside block params list: ' + params[1]);\n}","typeGuard":null,"tryCatchPattern":"try { parse(template) } catch (e) { /* e.message carries the interpolated state.message; log with template loc */ }","preventionTips":["Keep only simple identifiers inside `| ... |`","Avoid stray pipe characters in attribute areas","Lint templates in CI"],"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"}