{"record":{"id":"e7b729d2e7ed7534","repo":"BabylonJS/Babylon.js","slug":"could-not-find-data-in-connection-with-unique-id","errorCode":null,"errorMessage":"Could not find data in connection with unique id ${serializedConnection}","messagePattern":"Could not find data in connection with unique id (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FlowGraph/flowGraphParser.ts","lineNumber":245,"sourceCode":"            return;\n        }\n        connection.connectTo(connectedConnection);\n    };\n    for (const block of blocks) {\n        for (const dataIn of block.dataInputs) {\n            for (const serializedConnection of dataIn.connectedPointIds) {\n                const connection = dataOutMap.get(serializedConnection);\n                if (!connection) {\n                    throw new Error(\"Could not find data out connection with unique id \" + serializedConnection);\n                }\n                connectIfNeeded(dataIn, connection);\n            }\n        }\n        for (const dataOut of block.dataOutputs) {\n            for (const serializedConnection of dataOut.connectedPointIds) {\n                const connection = dataInMap.get(serializedConnection);\n                if (!connection) {\n                    throw new Error(\"Could not find data in connection with unique id \" + serializedConnection);\n                }\n                connectIfNeeded(dataOut, connection);\n            }\n        }\n        if (block instanceof FlowGraphExecutionBlock) {\n            for (const signalOut of block.signalOutputs) {\n                for (const serializedConnection of signalOut.connectedPointIds) {\n                    const connection = signalInMap.get(serializedConnection);\n                    if (!connection) {\n                        throw new Error(\"Could not find signal in connection with unique id \" + serializedConnection);\n                    }\n                    connectIfNeeded(signalOut, connection);\n                }\n            }\n            for (const signalIn of block.signalInputs) {\n                for (const serializedConnection of signalIn.connectedPointIds) {\n                    const connection = signalOutMap.get(serializedConnection);\n                    if (!connection) {","sourceCodeStart":227,"sourceCodeEnd":263,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FlowGraph/flowGraphParser.ts#L227-L263","documentation":"Thrown by ParseFlowGraph while reconnecting data outputs: a data output's connectedPointIds contains an id that has no matching data input in the dataInMap. Parsing stops because the graph topology cannot be reconstructed.","triggerScenarios":"Parsing a serialized flow graph where some dataOut.connectedPointIds references a data-input uniqueId that is missing from dataInMap (target block absent, input renamed/removed, or edited serialization).","commonSituations":"Graph serialized in a newer library version where an input was removed or renamed; manual JSON edits; blocks deleted leaving dangling connections; payload truncated during storage/transport.","solutions":["Re-serialize the graph from the current library version","Include all blocks that own referenced data inputs in the serialization","Remove or correct dangling connectedPointIds entries in the JSON","Pre-validate that every data-output connection id maps to an existing data input uniqueId"],"exampleFix":"// before\n{ \"dataOutputs\": [{ \"name\": \"out\", \"connectedPointIds\": [\"deletedInput\"] }] }\n// after\n{ \"dataOutputs\": [{ \"name\": \"out\", \"connectedPointIds\": [] }] }","handlingStrategy":"validation","validationCode":"function validateOutConnections(serialized: any): string[] {\n  const inIds = new Set(\n    serialized.blocks.flatMap((b: any) => (b.dataInputs ?? []).map((i: any) => i.uniqueId))\n  );\n  return serialized.blocks\n    .flatMap((b: any) => b.dataOutputs ?? [])\n    .flatMap((o: any) => o.connectedPointIds ?? [])\n    .filter((id: string) => !inIds.has(id));\n}","typeGuard":"function allOutRefsResolve(serialized: any): boolean {\n  const ins = new Set(serialized.blocks?.flatMap((b: any) => b.dataInputs?.map((i: any) => i.uniqueId) ?? []) ?? []);\n  return serialized.blocks?.every((b: any) =>\n    (b.dataOutputs ?? []).every((o: any) => (o.connectedPointIds ?? []).every((id: string) => ins.has(id)))\n  ) ?? false;\n}","tryCatchPattern":"try {\n  const graph = ParseFlowGraph(serialized, coordinator);\n} catch (e) {\n  if (String(e.message).startsWith('Could not find data in connection')) {\n    // dangling data-output reference; re-export the graph or drop the connection\n  }\n}","preventionTips":["Include every target block in serialized payloads so inputs are registered","Pre-validate data-output connection ids against existing data-input ids","Re-export graphs from the editor after renaming or removing block inputs"],"tags":["flow-graph","babylonjs","deserialization","broken-reference"],"backgroundTag":"broken-graph-reference","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}