BabylonJS/Babylon.js · error · Error

MultiGate should have a single configuration object, the num

Error message

MultiGate should have a single configuration object, the number of output flows

What it means

The flow/multiGate extraProcessor derives the MultiGate block's outputSignalCount from the number of keys in gltfBlock.flows. It throws when the op is not flow/multiGate or flows is absent/empty, since a MultiGate with zero output flows is meaningless.

Source

Thrown at packages/dev/loaders/src/glTF/2.0/Extensions/KHR_interactivity/declarationMapper.ts:1192

            values: {
                n: { name: "maxExecutions", gltfType: "number" },
            },
        },
        outputs: {
            values: {
                currentCount: { name: "executionCount" },
            },
        },
    },
    "flow/multiGate": {
        blocks: [FlowGraphBlockNames.MultiGate],
        configuration: {
            isRandom: { name: "isRandom", gltfType: "boolean", inOptions: true, defaultValue: false },
            isLoop: { name: "isLoop", gltfType: "boolean", inOptions: true, defaultValue: false },
        },
        extraProcessor(gltfBlock, declaration, _mapping, _arrays, serializedObjects) {
            if (declaration.op !== "flow/multiGate" || !gltfBlock.flows || Object.keys(gltfBlock.flows).length === 0) {
                throw new Error("MultiGate should have a single configuration object, the number of output flows");
            }
            const serializedObject = serializedObjects[0];
            serializedObject.config ||= {};
            serializedObject.config.outputSignalCount = Object.keys(gltfBlock.flows).length;
            serializedObject.signalOutputs.forEach((output, index) => {
                output.name = "out_" + index;
            });
            return serializedObjects;
        },
    },
    "flow/waitAll": {
        blocks: [FlowGraphBlockNames.WaitAll],
        configuration: {
            inputFlows: { name: "inputSignalCount", gltfType: "number", inOptions: true, defaultValue: 0 },
        },
        inputs: {
            flows: {
                reset: { name: "reset" },

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Declare the multiGate output flows, e.g. "flows": { "out_0": {}, "out_1": {} }
  2. Re-export the asset with an updated exporter
  3. Correct custom declaration mappings so only flow/multiGate blocks use this processor

Example fix

// before
{ "op": "flow/multiGate", "configuration": { "isRandom": { "value": [true] } } }
// after
{ "op": "flow/multiGate", "configuration": { "isRandom": { "value": [true] } }, "flows": { "out_0": {}, "out_1": {} } }
Defensive patterns

Strategy: validation

Validate before calling

function validateMultiGateBlock(block) {
  return typeof block.flows === "object" && block.flows !== null && Object.keys(block.flows).length > 0;
}
// verify multiGate blocks declare their output flows before loading

Type guard

const hasFlows = (b: { flows?: Record<string, unknown> | null }): b is { flows: Record<string, unknown> } => !!b.flows && Object.keys(b.flows).length > 0;

Try / catch

try {
  await loader.loadAsync(url);
} catch (e) {
  if (e instanceof Error && e.message.includes("MultiGate should have a single configuration")) {
    console.error("flow/multiGate block has no output flows declared.");
  } else throw e;
}

Prevention

When it happens

Trigger: An interactivity graph with a multiGate block lacking its out_X flow declarations, or a mis-mapped block routed to this processor with a different op.

Common situations: Exporter failing to write output flows for multiGate; manual JSON edits; schema drift between exporter drafts where outputs lived in configuration instead of flows.

Related errors


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