airbnb/lottie-web · error · Error

The property has no keyframe at index {ind}

Error message

The property has no keyframe at index {ind}

What it means

Thrown inside the expression engine's key(ind) accessor. key() indexes the property's keyframe array data.k. If data.k has no entries, or its first element is a plain number, the property is NOT keyframed (it holds a single static value) and therefore has no keyframes to index — so calling key(n) is invalid. The guard fires before any indexing, so the error message echoes the requested index.

Source

Thrown at player/js/utils/expressions/ExpressionManager.js:601

          }
          if (index === -1) {
            index = iKey + 1;
            keyTime = data.k[iKey].t;
          }
        }
      }
      var obKey = {};
      obKey.index = index;
      obKey.time = keyTime / elem.comp.globalData.frameRate;
      return obKey;
    }

    function key(ind) {
      var obKey;
      var iKey;
      var lenKey;
      if (!data.k.length || typeof (data.k[0]) === 'number') {
        throw new Error('The property has no keyframe at index ' + ind);
      }
      ind -= 1;
      obKey = {
        time: data.k[ind].t / elem.comp.globalData.frameRate,
        value: [],
      };
      var arr = Object.prototype.hasOwnProperty.call(data.k[ind], 's') ? data.k[ind].s : data.k[ind - 1].e;

      lenKey = arr.length;
      for (iKey = 0; iKey < lenKey; iKey += 1) {
        obKey[iKey] = arr[iKey];
        obKey.value[iKey] = arr[iKey];
      }
      return obKey;
    }

    function framesToTime(fr, fps) {
      if (!fps) {

View on GitHub (pinned to bede03d25d)

Solutions

  1. Guard the expression: only call key() when property.numKeys > 0.
  2. Add at least two keyframes to the property in After Effects so data.k becomes a keyframe array.
  3. Wrap the key() access in a try/catch inside the expression and fall back to the property's static value.

Example fix

// before (AE expression)
var k = thisProperty.key(1);
// after
var k = (thisProperty.numKeys > 0) ? thisProperty.key(1) : thisProperty.value;
Defensive patterns

Strategy: validation

Validate before calling

// Inside the After Effects expression, guard before indexing keyframes:
// (numKeys is provided by the expression interface for animated properties)
// return (thisProperty.numKeys > 0) ? thisProperty.key(1).value : thisProperty.value;

Type guard

// Expression guard — only call key() on keyframed properties:
// typeof thisProperty.numKeys === 'number' && thisProperty.numKeys > 0

Try / catch

// In an AE expression, fall back to the static value if key() is unavailable:
// var v;
// try { v = thisProperty.key(ind).value; }
// catch (e) { v = thisProperty.value; }
// v

Prevention

When it happens

Trigger: An After Effects expression calls property.key(n) (or numKeys-aware logic that still reaches key()) on a property that was never keyframed — i.e. its value is a constant. Also when the expression assumes keyframes exist but the source property was left static in the comp.

Common situations: Authoring expressions that call key() without first checking numKeys; reusing an expression written for an animated property on a static one; Lottie files where a property's keyframes were baked to a single value on export; referencing a control (e.g. a slider) that has no keyframes.

Related errors


AI-assisted analysis of airbnb/lottie-web@bede03d25d (2026-08-13). Data as JSON: /api/errors/e42081f9dfbd4630. Report an issue: GitHub.