BabylonJS/Babylon.js · error · Error

Could not find data out connection with unique id ${serializ

Error message

Could not find data out connection with unique id ${serializedConnection}

What it means

Thrown by ParseFlowGraph while reconnecting data inputs: a data input's connectedPointIds contains an id that has no matching data output in the dataOutMap. The graph cannot be fully rewired, so parsing aborts.

Source

Thrown at packages/dev/core/src/FlowGraph/flowGraphParser.ts:236

                signalInMap.set(signalIn.uniqueId, signalIn);
            }
            for (const signalOut of block.signalOutputs) {
                signalOutMap.set(signalOut.uniqueId, signalOut);
            }
        }
    }
    const connectIfNeeded = <ConnectionT extends FlowGraphConnection<any, any>>(connection: ConnectionT, connectedConnection: ConnectionT) => {
        if (connection._connectedPoint.indexOf(connectedConnection) !== -1) {
            return;
        }
        connection.connectTo(connectedConnection);
    };
    for (const block of blocks) {
        for (const dataIn of block.dataInputs) {
            for (const serializedConnection of dataIn.connectedPointIds) {
                const connection = dataOutMap.get(serializedConnection);
                if (!connection) {
                    throw new Error("Could not find data out connection with unique id " + serializedConnection);
                }
                connectIfNeeded(dataIn, connection);
            }
        }
        for (const dataOut of block.dataOutputs) {
            for (const serializedConnection of dataOut.connectedPointIds) {
                const connection = dataInMap.get(serializedConnection);
                if (!connection) {
                    throw new Error("Could not find data in connection with unique id " + serializedConnection);
                }
                connectIfNeeded(dataOut, connection);
            }
        }
        if (block instanceof FlowGraphExecutionBlock) {
            for (const signalOut of block.signalOutputs) {
                for (const serializedConnection of signalOut.connectedPointIds) {
                    const connection = signalInMap.get(serializedConnection);
                    if (!connection) {

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Re-export/re-serialize the flow graph with the current library version
  2. Ensure the serialization includes all blocks referenced by connections (don't strip blocks)
  3. Fix or remove stale connectedPointIds entries in the serialized JSON
  4. Validate every connectedPointId against the existing data-output uniqueIds before parsing

Example fix

// before (stale id after block removal)
{ "dataInputs": [{ "name": "a", "connectedPointIds": ["removedOutput"] }] }
// after
{ "dataInputs": [{ "name": "a", "connectedPointIds": ["existingOutputId"] }] }
Defensive patterns

Strategy: validation

Validate before calling

function validateConnections(serialized: any): string[] {
  const outIds = new Set(
    serialized.blocks.flatMap((b: any) => (b.dataOutputs ?? []).map((o: any) => o.uniqueId))
  );
  const bad = serialized.blocks
    .flatMap((b: any) => b.dataInputs ?? [])
    .flatMap((i: any) => i.connectedPointIds ?? [])
    .filter((id: string) => !outIds.has(id));
  return bad; // empty array means all references resolve
}

Type guard

function allDataRefsResolve(serialized: any): boolean {
  const outs = new Set(serialized.blocks?.flatMap((b: any) => b.dataOutputs?.map((o: any) => o.uniqueId) ?? []) ?? []);
  return serialized.blocks?.every((b: any) =>
    (b.dataInputs ?? []).every((i: any) => (i.connectedPointIds ?? []).every((id: string) => outs.has(id)))
  ) ?? false;
}

Try / catch

try {
  const graph = ParseFlowGraph(serialized, coordinator);
} catch (e) {
  if (String(e.message).startsWith('Could not find data out connection')) {
    // dangling data-input reference in the payload; re-export or strip it
  }
}

Prevention

When it happens

Trigger: Parsing a serialized flow graph where some dataIn.connectedPointIds references a data-output uniqueId that is absent (block removed, id renamed, or serialization edited) so dataOutMap.get() returns undefined.

Common situations: Serialized graph produced by a newer library version whose block outputs changed; manually editing the serialization JSON; deleting blocks in the editor while stale connections remain; partial graph payloads.

Related errors


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