BabylonJS/Babylon.js · error · Error

Error validating interactivity node ${this._interactivityGra

Error message

Error validating interactivity node ${this._interactivityGraph.declarations?.[node.declaration].op} - ${validationResult.error}

What it means

Thrown in _parseNodes when the mapped declaration's per-operation `validation` callback reports the node invalid. Unlike the generic parse errors, this message includes the declaration's op name and the validator's specific error string, pinpointing which interactivity operation failed its structural validation (inputs, configuration, or graph reference checks).

Source

Thrown at packages/dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/interactivityGraphParser.ts:249

    private _parseNodes() {
        if (!this._interactivityGraph.nodes) {
            return;
        }
        for (const node of this._interactivityGraph.nodes) {
            // some validation
            if (typeof node.declaration !== "number") {
                Logger.Error(["No declaration found for node", node]);
                throw new Error("Error parsing nodes");
            }
            const mapping = this._mappings[node.declaration];
            if (!mapping) {
                Logger.Error(["No mapping found for node", node]);
                throw new Error("Error parsing nodes");
            }
            if (mapping.flowGraphMapping.validation) {
                const validationResult = mapping.flowGraphMapping.validation(node, this._interactivityGraph, this._gltf);
                if (!validationResult.valid) {
                    throw new Error(`Error validating interactivity node ${this._interactivityGraph.declarations?.[node.declaration].op} - ${validationResult.error}`);
                }
            }
            const blocks: ISerializedFlowGraphBlock[] = [];
            // create block(s) for this node using the mapping
            for (const blockType of mapping.flowGraphMapping.blocks) {
                const block = this._getEmptyBlock(blockType, mapping.fullOperationName);
                this._parseNodeConfiguration(node, block, mapping.flowGraphMapping, blockType);
                blocks.push(block);
            }
            this._nodes.push({ blocks, fullOperationName: mapping.fullOperationName });
        }
    }

    private _getEmptyBlock(className: string, type: string): ISerializedFlowGraphBlock {
        return {
            uniqueId: RandomGUID(),
            className,
            dataInputs: [],

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Read the op name and error detail in the message to see exactly which node/operation failed and why
  2. Fix the offending node's configuration or input wiring in the asset per the reported error
  3. Validate the asset with the glTF KHR_interactivity schema/validator before loading
  4. Update Babylon.js in case the validator is stricter than the asset spec version requires

Example fix

// before: node for op "math/add" missing required configuration
{ "declaration": 0 }
// after: supply required inputs/configuration
{ "declaration": 0, "configuration": { "a": { "value": [1] }, "b": { "value": [2] } } }
Defensive patterns

Strategy: try-catch

Validate before calling

// Run the same validators the parser would run, before constructing the parser:
for (const node of graph.nodes ?? []) {
  const mapping = getMappingForDeclaration(graph.declarations?.[node.declaration]);
  const result = mapping?.validation?.(node, graph, gltf);
  if (result && !result.valid) console.warn(`Node ${node.declaration} invalid: ${result.error}`);
}

Type guard

null

Try / catch

try {
  const parser = new InteractivityGraphToFlowGraphParser(graph, gltf);
} catch (e) {
  if (e.message.startsWith('Error validating interactivity node')) {
    // message contains the op name and validator error — surface it to the artist
    console.error('Invalid interactivity asset:', e.message);
    return null; // or load without interactivity
  }
  throw e;
}

Prevention

When it happens

Trigger: A node passes declaration/mapping lookup but its mapped IGLTFToFlowGraphMapping.validation(node, graph, gltf) returns { valid: false, error } — e.g. wrong input count, missing required configuration, invalid socket references for that op.

Common situations: Assets using an operation with parameters outside its allowed ranges; nodes wired with incorrect configuration values that only the op-specific validator can detect; exporter bugs producing semantically invalid nodes.

Related errors


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