emberjs/ember.js · error · Error

invalid keypath: '${path}', valid keys: @index, @identity, o

Error message

invalid keypath: '${path}', valid keys: @index, @identity, or a path

What it means

Error "invalid keypath: '${path}', valid keys: @index, @identity, or a path" thrown in emberjs/ember.js.

Source

Thrown at packages/@glimmer/reference/lib/iterable.ts:55

type KeyFor = (item: unknown, index: unknown) => unknown;

const NULL_IDENTITY = {};

const KEY: KeyFor = (_, index) => index;
const INDEX: KeyFor = (_, index) => String(index);
const IDENTITY: KeyFor = (item) => {
  if (item === null) {
    // Returning null as an identity will cause failures since the iterator
    // can't tell that it's actually supposed to be null
    return NULL_IDENTITY;
  }

  return item;
};

function keyForPath(path: string): KeyFor {
  if (DEBUG && path[0] === '@') {
    throw new Error(`invalid keypath: '${path}', valid keys: @index, @identity, or a path`);
  }
  return uniqueKeyFor((item) => {
    if (item === null || item === undefined) {
      return item;
    }
    return getPath(item, path);
  });
}

function makeKeyFor(key: string) {
  switch (key) {
    case '@key':
      return uniqueKeyFor(KEY);
    case '@index':
      return uniqueKeyFor(INDEX);
    case '@identity':
      return uniqueKeyFor(IDENTITY);
    default:

View on GitHub (pinned to 26f97246a8)

When it happens

Trigger: Thrown at packages/@glimmer/reference/lib/iterable.ts:55 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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