{"record":{"id":"3c3a6d3727bdaaa3","repo":"BabylonJS/Babylon.js","slug":"could-not-find-data-out-connection-with-unique-id-3c3a6d","errorCode":null,"errorMessage":"Could not find data out connection with unique id ${serializedConnection}","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":236,"sourceCode":"                signalInMap.set(signalIn.uniqueId, signalIn);\n            }\n            for (const signalOut of block.signalOutputs) {\n                signalOutMap.set(signalOut.uniqueId, signalOut);\n            }\n        }\n    }\n    const connectIfNeeded = <ConnectionT extends FlowGraphConnection<any, any>>(connection: ConnectionT, connectedConnection: ConnectionT) => {\n        if (connection._connectedPoint.indexOf(connectedConnection) !== -1) {\n            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) {","sourceCodeStart":218,"sourceCodeEnd":254,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FlowGraph/flowGraphParser.ts#L218-L254","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-export/re-serialize the flow graph with the current library version","Ensure the serialization includes all blocks referenced by connections (don't strip blocks)","Fix or remove stale connectedPointIds entries in the serialized JSON","Validate every connectedPointId against the existing data-output uniqueIds before parsing"],"exampleFix":"// before (stale id after block removal)\n{ \"dataInputs\": [{ \"name\": \"a\", \"connectedPointIds\": [\"removedOutput\"] }] }\n// after\n{ \"dataInputs\": [{ \"name\": \"a\", \"connectedPointIds\": [\"existingOutputId\"] }] }","handlingStrategy":"validation","validationCode":"function validateConnections(serialized: any): string[] {\n  const outIds = new Set(\n    serialized.blocks.flatMap((b: any) => (b.dataOutputs ?? []).map((o: any) => o.uniqueId))\n  );\n  const bad = serialized.blocks\n    .flatMap((b: any) => b.dataInputs ?? [])\n    .flatMap((i: any) => i.connectedPointIds ?? [])\n    .filter((id: string) => !outIds.has(id));\n  return bad; // empty array means all references resolve\n}","typeGuard":"function allDataRefsResolve(serialized: any): boolean {\n  const outs = new Set(serialized.blocks?.flatMap((b: any) => b.dataOutputs?.map((o: any) => o.uniqueId) ?? []) ?? []);\n  return serialized.blocks?.every((b: any) =>\n    (b.dataInputs ?? []).every((i: any) => (i.connectedPointIds ?? []).every((id: string) => outs.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 out connection')) {\n    // dangling data-input reference in the payload; re-export or strip it\n  }\n}","preventionTips":["Never manually remove blocks from serialized graphs without cleaning connections","Validate connectedPointIds against declared uniqueIds before parsing","Re-export graphs after upgrading the library"],"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"}