BabylonJS/Babylon.js · error

nodeIndex not found in configuration

Error message

nodeIndex not found in configuration

What it means

The KHR_node_hoverability extension post-processes the scene with NodeMaterial / serialized blocks. It reads a numeric 'nodeIndex' from the glTF input block's configuration to know which mesh to attach the pointer listener to. If the block configuration lacks a valid numeric nodeIndex, the extension cannot bind the hover variable and throws.

Source

Thrown at packages/dev/loaders/src/glTF/2.0/Extensions/KHR_node_hoverability.pure.ts:127

                isVariable: true,
            },
            {
                input: "object",
                output: "meshUnderPointer",
                inputBlockIndex: 2,
                outputBlockIndex: 0,
                isVariable: true,
            },
        ],
        extraProcessor(gltfBlock, _declaration, _mapping, _arrays, serializedObjects, context, globalGLTF) {
            // add the glTF to the configuration of the last serialized object
            const serializedObject = serializedObjects[serializedObjects.length - 1];
            serializedObject.config = serializedObject.config || {};
            serializedObject.config.glTF = globalGLTF;
            // find the listener nodeIndex value
            const nodeIndex = gltfBlock.configuration?.["nodeIndex"]?.value?.[0];
            if (nodeIndex === undefined || typeof nodeIndex !== "number") {
                throw new Error("nodeIndex not found in configuration");
            }
            const variableName = MeshPointerOverPrefix + nodeIndex;
            // find the nodeIndex value
            serializedObjects[1].config.variable = variableName;
            context._userVariables[variableName] = {
                className: "Mesh",
                id: globalGLTF?.nodes?.[nodeIndex]._babylonTransformNode?.id,
                uniqueId: globalGLTF?.nodes?.[nodeIndex]._babylonTransformNode?.uniqueId,
            };
            return serializedObjects;
        },
    });

    addNewInteractivityFlowGraphMapping("event/onHoverOut", NAME, {
        // using GetVariable as the nodeIndex is a configuration and not a value (i.e. it's not mutable)
        blocks: [FlowGraphBlockNames.PointerOutEvent, FlowGraphBlockNames.GetVariable, FlowGraphBlockNames.IndexOf, "KHR_interactivity/FlowGraphGLTFDataProvider"],
        configuration: {
            stopPropagation: { name: "stopPropagation" },

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Fix the asset so the hover block's configuration includes nodeIndex: { value: [<number>] }.
  2. Re-export the glTF with an exporter that emits KHR_node_hoverability configuration correctly.
  3. Remove the KHR_node_hoverability extension from the asset if hover behavior is not needed.

Example fix

// asset json: before
"configuration": {}
// after
"configuration": { "nodeIndex": { "value": [3] } }
Defensive patterns

Strategy: validation

Validate before calling

const idx = block?.configuration?.nodeIndex?.value?.[0];
if (typeof idx !== 'number') throw new Error('KHR_node_hoverability block missing numeric nodeIndex');

Type guard

function hasNumericNodeIndex(block: any): boolean {
  const v = block?.configuration?.['nodeIndex']?.value?.[0];
  return typeof v === 'number' && Number.isFinite(v);
}

Try / catch

try { await loader.loadAsync(url); } catch (e) {
  if (e.message.includes('nodeIndex not found')) {
    // fall back: load asset without the hoverability extension or fix asset
  } else throw e;
}

Prevention

When it happens

Trigger: Loading a glTF whose KHR_node_hoverability NodeMaterial serialization omits configuration['nodeIndex'] (missing, wrong type, or empty value array) while processing pointer-over extra blocks via extraProcessor.

Common situations: Hand-authored or tool-exported KHR_node_hoverability data where the graph blocks weren't configured with nodeIndex; editing serialized NodeMaterial output by an exporter and dropping configuration keys.

Related errors


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