BabylonJS/Babylon.js · error · Error

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

Error message

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

What it means

Thrown by GetDataOutConnectionByUniqueId when no block in the provided list has a data output whose uniqueId matches the requested value. The lookup scans all blocks' dataOutputs and throws rather than returning undefined.

Source

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

        }
    }
}

/**
 * Given a list of blocks, find an output data connection that has a specific unique id
 * @param blocks a list of flow graph blocks
 * @param uniqueId the unique id of a connection
 * @returns the connection that has this unique id. throws an error if none was found
 */
export function GetDataOutConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphDataConnection<any> {
    for (const block of blocks) {
        for (const dataOut of block.dataOutputs) {
            if (dataOut.uniqueId === uniqueId) {
                return dataOut;
            }
        }
    }
    throw new Error("Could not find data out connection with unique id " + uniqueId);
}

/**
 * Given a list of blocks, find an input signal connection that has a specific unique id
 * @param blocks a list of flow graph blocks
 * @param uniqueId the unique id of a connection
 * @returns the connection that has this unique id. throws an error if none was found
 */
export function GetSignalInConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphSignalConnection {
    for (const block of blocks) {
        if (block instanceof FlowGraphExecutionBlock) {
            for (const signalIn of block.signalInputs) {
                if (signalIn.uniqueId === uniqueId) {
                    return signalIn;
                }
            }
        }
    }

View on GitHub (pinned to 0592b347b8)

Solutions

  1. Pass the complete block list from the parsed graph to the lookup
  2. Verify the uniqueId exists in the graph's serialization JSON before lookup
  3. Re-resolve uniqueIds by re-parsing the source serialization
  4. Filter the id to those of type data output (dataOutputs, not dataInputs or signalConnections)

Example fix

// before
const conn = GetDataOutConnectionByUniqueId(partialBlocks, 'abc');
// after
const conn = GetDataOutConnectionByUniqueId(allBlocks, 'abc'); // all blocks included
Defensive patterns

Strategy: validation

Validate before calling

function findDataOut(blocks: any[], uniqueId: string) {
  const conn = blocks.flatMap((b) => b.dataOutputs ?? []).find((c) => c.uniqueId === uniqueId);
  if (!conn) throw new Error(`Unknown data-out id: ${uniqueId}`);
  return conn;
}

Type guard

function hasDataOut(blocks: { dataOutputs: { uniqueId: string }[] }[], uniqueId: string): boolean {
  return blocks.some((b) => b.dataOutputs?.some((c) => c.uniqueId === uniqueId));
}

Try / catch

try {
  const conn = GetDataOutConnectionByUniqueId(blocks, id);
} catch (e) {
  if (String(e.message).startsWith('Could not find data out connection')) {
    // id belongs to another graph or connection kind
  }
}

Prevention

When it happens

Trigger: Calling GetDataOutConnectionByUniqueId(blocks, uniqueId) with a uniqueId that is not present in any block's dataOutputs array — e.g. an id belonging to a data input, signal connection, or a block from another graph.

Common situations: Deserializing connections referencing blocks that were removed from the list; uniqueIds changed after re-serialization; copying ids between different flow graph instances.

Related errors


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