BabylonJS/Babylon.js · error · Error

${extensionContext}: Pointer is missing

Error message

${extensionContext}: Pointer is missing

What it means

KHR_animation_pointer channels must contain an extension object with a JSON-pointer string identifying the animated property. When extension.pointer is absent/empty, _loadAnimationChannelAsync throws immediately, since without the pointer no target property can be resolved.

Source

Thrown at packages/dev/loaders/src/glTF/2.0/Extensions/KHR_animation_pointer.pure.ts:84

    ): Nullable<Promise<void>> {
        const extension = channel.target.extensions?.KHR_animation_pointer as IKHRAnimationPointer;
        if (!extension || !this._pathToObjectConverter) {
            return null;
        }

        if (channel.target.path !== AnimationChannelTargetPath.POINTER) {
            Logger.Warn(`${context}/target/path: Value (${channel.target.path}) must be (${AnimationChannelTargetPath.POINTER}) when using the ${this.name} extension`);
        }

        if (channel.target.node != undefined) {
            Logger.Warn(`${context}/target/node: Value (${channel.target.node}) must not be present when using the ${this.name} extension`);
        }

        const extensionContext = `${context}/extensions/${this.name}`;

        const pointer = extension.pointer;
        if (!pointer) {
            throw new Error(`${extensionContext}: Pointer is missing`);
        }

        try {
            const obj = this._pathToObjectConverter.convert(pointer);
            if (!obj.info.interpolation) {
                throw new Error(`${extensionContext}/pointer: Interpolation is missing`);
            }
            return this._loader._loadAnimationChannelFromTargetInfoAsync(
                context,
                animationContext,
                animation,
                channel,
                {
                    object: obj.object,
                    info: obj.info.interpolation,
                },
                onLoad
            );

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Add the missing 'pointer' string (e.g. "/materials/0/pbrMetallicRoughness/baseColorFactor") to the channel extension
  2. Re-export the asset so the animation pointer is written correctly
  3. Remove channels that have no pointer target
  4. Validate the glTF to detect malformed KHR_animation_pointer channels

Example fix

// before
"extensions": { "KHR_animation_pointer": {} }
// after
"extensions": { "KHR_animation_pointer": { "pointer": "/materials/0/pbrMetallicRoughness/baseColorFactor" } }
Defensive patterns

Strategy: validation

Validate before calling

for (const anim of asset.animations ?? []) {
  for (const ch of anim.channels ?? []) {
    const ext = ch.target?.extensions?.KHR_animation_pointer;
    if (ext && typeof ext.pointer !== 'string') {
      throw new Error(`Animation channel missing KHR_animation_pointer pointer`);
    }
  }
}

Type guard

function hasPointer(ext: { pointer?: string }): ext is { pointer: string } {
  return typeof ext.pointer === 'string' && ext.pointer.length > 0;
}

Try / catch

try {
  await BABYLON.SceneLoader.LoadAsync('./', 'anim.gltf', engine);
} catch (e) {
  if (e instanceof Error && e.message.includes('Pointer is missing')) {
    console.error('Animation channel lacks KHR_animation_pointer pointer');
  } else throw e;
}

Prevention

When it happens

Trigger: Loading a glTF 2.0 animation channel whose KHR_animation_pointer extension object lacks the 'pointer' property, or where pointer is an empty string.

Common situations: Hand-authored animation-pointer channels; exporters emitting the extension registration but dropping pointer on some channels; asset post-processing/minification stripping fields.

Understand the failure class

Background: "Missing required field" and "field is required" errors: why libraries reject payloads that omit mandatory fields — this error's family across 20 libraries.

Related errors


AI-assisted analysis of BabylonJS/Babylon.js@0592b347b8 (2026-08-30). Data as JSON: /api/errors/d3395dc05c7afce2. Report an issue: GitHub.