emberjs/ember.js · error · SyntaxError

'.' is not a supported path in Glimmer; check for a path wit

Error message

'.' is not a supported path in Glimmer; check for a path with a trailing '.'

What it means

A path expression that is exactly '.' is meaningless in Glimmer and usually indicates a typo such as a trailing dot ({{foo.}}) or a lone {{.}}. The parser's PathExpression visitor special-cases original === '.' and throws a syntax error pointing at the path's location.

Source

Thrown at packages/@glimmer/syntax/lib/parser/handlebars-node-visitors.ts:418

          `Using "./" is not supported in Glimmer and unnecessary`,
          this.source.spanFor(path.loc)
        );
      }
      if (original.slice(0, 3) === '../') {
        throw generateSyntaxError(
          `Changing context using "../" is not supported in Glimmer`,
          this.source.spanFor(path.loc)
        );
      }
      if (original.indexOf('.') !== -1) {
        throw generateSyntaxError(
          `Mixing '.' and '/' in paths is not supported in Glimmer; use only '.' to separate property paths`,
          this.source.spanFor(path.loc)
        );
      }
      parts = [path.parts.join('/')];
    } else if (original === '.') {
      throw generateSyntaxError(
        `'.' is not a supported path in Glimmer; check for a path with a trailing '.'`,
        this.source.spanFor(path.loc)
      );
    } else {
      parts = path.parts;
    }

    let thisHead = false;

    // This is to fix a bug in the Handlebars AST where the path expressions in
    // `{{this.foo}}` (and similarly `{{foo-bar this.foo named=this.foo}}` etc)
    // are simply turned into `{{foo}}`. The fix is to push it back onto the
    // parts array and let the runtime see the difference. However, we cannot
    // simply use the string `this` as it means literally the property called
    // "this" in the current context (it can be expressed in the syntax as
    // `{{[this]}}`, where the square bracket are generally for this kind of
    // escaping – such as `{{foo.["bar.baz"]}}` would mean lookup a property
    // named literally "bar.baz" on `this.foo`). By convention, we use `null`

View on GitHub (pinned to 26f97246a8)

Solutions

  1. Replace {{.}} with the explicit reference you want: use {{this}} for the current component/element context, or the specific block param name.
  2. Check the indicated location for a trailing '.' and remove it or complete the property name ({{item.}} → {{item.name}}).
  3. If you meant to print the whole context, bind it to a variable first ({{#let this as |ctx|}}{{ctx.name}}{{/let}}) — although rendering raw context is usually a mistake.

Example fix

// before
{{#each items as |item|}}
  {{item.}}
{{/each}}

// after
{{#each items as |item|}}
  {{item.name}}
{{/each}}
Defensive patterns

Strategy: validation

Validate before calling

// detect bare/trailing-dot paths before compiling
function assertNoBareDot(template) {
  if (/{{\s*\.\s*}}/.test(template)) throw new Error("Bare '.' path found; use an explicit reference");
  if (/{{[^}]*\.\s*}}/.test(template)) throw new Error("Possible trailing '.' in a path");
}
assertNoBareDot(template);

Prevention

When it happens

Trigger: Compiling a template containing the bare path expression {{.}} or {{^x.}}-style trailing-dot typos that reduce to '.', e.g. {{item.}} normally fails earlier, but any expression whose original normalizes to '.' hits this branch. Thrown in the else-if (original === '.') arm of the visitor.

Common situations: Hand-editing templates and leaving a trailing '.' after deleting a property name; copy/paste artifacts; macro or codegen tools emitting {{.}} for 'current context' (a handlebars.js-ism not supported by Glimmer).

Related errors


AI-assisted analysis of emberjs/ember.js@26f97246a8 (2026-09-01). Data as JSON: /api/errors/62bebe6e4be8a242. Report an issue: GitHub.