{"record":{"id":"264c685beae4e46d","repo":"emberjs/ember.js","slug":"attempted-to-parse-a-path-expression-but-it-was-n","errorCode":null,"errorMessage":"Attempted to parse a path expression, but it was not valid. Paths beginning with @ must start with a-z.","messagePattern":"Attempted to parse a path expression, but it was not valid\\. Paths beginning with @ must start with a-z\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/@glimmer/syntax/lib/parser/handlebars-node-visitors.ts","lineNumber":454,"sourceCode":"    // named literally \"bar.baz\" on `this.foo`). By convention, we use `null`\n    // for this purpose.\n    if (/^this(?:\\..+)?$/u.test(original)) {\n      thisHead = true;\n    }\n\n    let pathHead: ASTv1.PathHead;\n    if (thisHead) {\n      pathHead = b.this({\n        loc: this.source.spanFor({\n          start: path.loc.start,\n          end: { line: path.loc.start.line, column: path.loc.start.column + 4 },\n        }),\n      });\n    } else if (path.data) {\n      const head = parts.shift();\n\n      if (head === undefined) {\n        throw generateSyntaxError(\n          `Attempted to parse a path expression, but it was not valid. Paths beginning with @ must start with a-z.`,\n          this.source.spanFor(path.loc)\n        );\n      }\n\n      pathHead = b.atName({\n        name: `@${head}`,\n        loc: this.source.spanFor({\n          start: path.loc.start,\n          end: { line: path.loc.start.line, column: path.loc.start.column + head.length + 1 },\n        }),\n      });\n    } else {\n      const head = parts.shift();\n\n      if (head === undefined) {\n        throw generateSyntaxError(\n          `Attempted to parse a path expression, but it was not valid. Paths must start with a-z or A-Z.`,","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/emberjs/ember.js/blob/26f97246a8bf2e28edf26ac3093da2e86c04ffc5/packages/@glimmer/syntax/lib/parser/handlebars-node-visitors.ts#L436-L472","documentation":"For data paths (paths starting with @, i.e. @arg references to named arguments), the parser shifts the head segment off the path parts; if there is no head segment the @arg path is malformed, so the parser throws. A valid @path must start with a lowercase letter a-z after the @ (e.g. @name, @items).","triggerScenarios":"Compiling a template with a PathExpression marked data=true whose parts array is empty after validation — e.g. a bare or malformed @arg reference like {{@}} or {{@.x}} reaching the parser. Thrown when path.data is true and parts.shift() returns undefined.","commonSituations":"Typos such as {{@}} or an editor autocompleting an @arg before the name is typed; code generators emitting '@' placeholders; copy/paste from languages where @ has other meanings (CSS @rules, decorators).","solutions":["Give the @arg a valid lowercase name: {{@}} → {{@value}} or whatever the declared argument is.","Verify the component actually declares/uses that argument and that the name after @ starts with a-z (no digits or uppercase, e.g. @items not @Items).","Check for a stray character after @ (like {{@.x}}) and write the full path, e.g. {{@user.name}}."],"exampleFix":"// before\n<Greeting @ />\n\n// after\n<Greeting @name=\"world\" />","handlingStrategy":"validation","validationCode":"// validate @arg references before compiling\nfunction assertValidAtArgs(template) {\n  const bad = template.match(/@\\s*[^a-z][\\w.]*/g);\n  if (bad) throw new Error(`Invalid @arg reference(s): ${bad.join(', ')}; must start with a-z`);\n}\nassertValidAtArgs(template);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always name @args with lowercase letters: @name, @items","Check every @ reference has a complete name (never a bare @)","Confirm the component signature declares each @arg you use","Use TypeScript/glint for typed template args to catch typos"],"tags":["glimmer","handlebars","template-syntax","named-arguments"],"backgroundTag":"glimmer-invalid-at-arg-path","analyzedSha":"26f97246a8bf2e28edf26ac3093da2e86c04ffc5","analyzedAt":"2026-09-01T05:01:28.182Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}