{"record":{"id":"a91384b43756b7fd","repo":"BabylonJS/Babylon.js","slug":"could-not-find-data-out-connection-with-unique-id","errorCode":null,"errorMessage":"Could not find data out connection with unique id ${uniqueId}","messagePattern":"Could not find data out connection with unique id (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FlowGraph/flowGraphParser.ts","lineNumber":63,"sourceCode":"        }\n    }\n}\n\n/**\n * Given a list of blocks, find an output data connection that has a specific unique id\n * @param blocks a list of flow graph blocks\n * @param uniqueId the unique id of a connection\n * @returns the connection that has this unique id. throws an error if none was found\n */\nexport function GetDataOutConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphDataConnection<any> {\n    for (const block of blocks) {\n        for (const dataOut of block.dataOutputs) {\n            if (dataOut.uniqueId === uniqueId) {\n                return dataOut;\n            }\n        }\n    }\n    throw new Error(\"Could not find data out connection with unique id \" + uniqueId);\n}\n\n/**\n * Given a list of blocks, find an input signal connection that has a specific unique id\n * @param blocks a list of flow graph blocks\n * @param uniqueId the unique id of a connection\n * @returns the connection that has this unique id. throws an error if none was found\n */\nexport function GetSignalInConnectionByUniqueId(blocks: FlowGraphBlock[], uniqueId: string): FlowGraphSignalConnection {\n    for (const block of blocks) {\n        if (block instanceof FlowGraphExecutionBlock) {\n            for (const signalIn of block.signalInputs) {\n                if (signalIn.uniqueId === uniqueId) {\n                    return signalIn;\n                }\n            }\n        }\n    }","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FlowGraph/flowGraphParser.ts#L45-L81","documentation":"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.","triggerScenarios":"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.","commonSituations":"Deserializing connections referencing blocks that were removed from the list; uniqueIds changed after re-serialization; copying ids between different flow graph instances.","solutions":["Pass the complete block list from the parsed graph to the lookup","Verify the uniqueId exists in the graph's serialization JSON before lookup","Re-resolve uniqueIds by re-parsing the source serialization","Filter the id to those of type data output (dataOutputs, not dataInputs or signalConnections)"],"exampleFix":"// before\nconst conn = GetDataOutConnectionByUniqueId(partialBlocks, 'abc');\n// after\nconst conn = GetDataOutConnectionByUniqueId(allBlocks, 'abc'); // all blocks included","handlingStrategy":"validation","validationCode":"function findDataOut(blocks: any[], uniqueId: string) {\n  const conn = blocks.flatMap((b) => b.dataOutputs ?? []).find((c) => c.uniqueId === uniqueId);\n  if (!conn) throw new Error(`Unknown data-out id: ${uniqueId}`);\n  return conn;\n}","typeGuard":"function hasDataOut(blocks: { dataOutputs: { uniqueId: string }[] }[], uniqueId: string): boolean {\n  return blocks.some((b) => b.dataOutputs?.some((c) => c.uniqueId === uniqueId));\n}","tryCatchPattern":"try {\n  const conn = GetDataOutConnectionByUniqueId(blocks, id);\n} catch (e) {\n  if (String(e.message).startsWith('Could not find data out connection')) {\n    // id belongs to another graph or connection kind\n  }\n}","preventionTips":["Look up ids only within the same parsed graph instance","Distinguish data-output ids from data-input and signal ids","Re-resolve ids after any graph re-serialization"],"tags":["flow-graph","babylonjs","lookup-failed","uniqueid"],"backgroundTag":"unknown-identifier-lookup","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}