BabylonJS/Babylon.js · error · Error

Receive event should have a single configuration object, the

Error message

Receive event should have a single configuration object, the event itself

What it means

The KHR_interactivity 'event/send' block mapping expects the glTF block's configuration to contain exactly one key named "event" holding the event being sent. The extraProcessor validates the declaration op is event/send and that configuration is a single-key object; otherwise it throws this (slightly misleadingly worded) error before reading the event id.

Source

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

        inputs: {},
        outputs: {
            values: {
                timeSinceLastTick: { name: "deltaTime", gltfType: "number" /*, dataTransformer: (time: number) => time / 1000*/ },
                // KHR_interactivity `ref event` output (the event reference).
                event: { name: "event" },
            },
            flows: {
                out: { name: "done" },
            },
        },
    },
    "event/send": {
        blocks: [FlowGraphBlockNames.SendCustomEvent],
        extraProcessor(gltfBlock, declaration, _mapping, parser, serializedObjects) {
            // set eventId and eventData. The configuration object of the glTF should have a single object.
            // validate that we are running it on the right block.
            if (declaration.op !== "event/send" || !gltfBlock.configuration || Object.keys(gltfBlock.configuration).length !== 1) {
                throw new Error("Receive event should have a single configuration object, the event itself");
            }
            const eventConfiguration = gltfBlock.configuration["event"];
            const eventId = eventConfiguration.value?.[0];
            if (typeof eventId !== "number") {
                throw new Error("Event id should be a number");
            }
            const event: InteractivityEvent = parser.arrays.events[eventId];
            const serializedObject = serializedObjects[0];
            serializedObject.config ||= {};
            serializedObject.config.eventId = event.eventId;
            serializedObject.config.eventData = event.eventData;
            return serializedObjects;
        },
    },
    "event/receive": {
        blocks: [FlowGraphBlockNames.ReceiveCustomEvent],
        outputs: {
            values: {

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Ensure the event/send glTF block's configuration has exactly one key: { "event": { "value": [<eventId>] } }
  2. Re-export the asset with a KHR_interactivity-compliant exporter
  3. Verify the block's op is "event/send" and that your custom declaration mapping routes it to the correct processor

Example fix

// before
"configuration": { "event": { "value": [3] }, "extra": true }
// after
"configuration": { "event": { "value": [3] } }
Defensive patterns

Strategy: validation

Validate before calling

function validateSendEventConfig(block) {
  const keys = block.configuration ? Object.keys(block.configuration) : [];
  return keys.length === 1 && keys[0] === "event" && typeof block.configuration.event.value?.[0] === "number";
}
// validate every event/send block in glTF.extensions.KHR_interactivity before parsing

Try / catch

try {
  await loader.loadAsync(url);
} catch (e) {
  if (e instanceof Error && e.message.includes("single configuration object")) {
    console.error("event/send block has malformed configuration; fix the interactivity JSON.");
  } else throw e;
}

Prevention

When it happens

Trigger: Parsing a KHR_interactivity graph where an event/send block has no configuration, a configuration with zero or multiple keys, or where the mapping is applied to a block whose declaration.op is not "event/send" (mismatched block-to-declaration wiring).

Common situations: Assets produced by older interactivity exporters with a different configuration schema; hand-edited JSON renaming or adding configuration keys; a custom declaration map misrouting blocks to the event/send processor.

Related errors


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