{"record":{"id":"d302208899f1438f","repo":"BabylonJS/Babylon.js","slug":"cannot-connect-two-points-of-type-this-connectio","errorCode":null,"errorMessage":"Cannot connect two points of type ${this.connectionType}","messagePattern":"Cannot connect two points of type (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/FlowGraph/flowGraphConnection.ts","lineNumber":105,"sourceCode":"    public _isSingularConnection(): boolean {\r\n        return true;\r\n    }\r\n\r\n    /**\r\n     * Returns if a point is connected to any other point.\r\n     * @returns boolean indicating if the point is connected.\r\n     */\r\n    public isConnected(): boolean {\r\n        return this._connectedPoint.length > 0;\r\n    }\r\n\r\n    /**\r\n     * Connects two connections together.\r\n     * @param point the connection to connect to.\r\n     */\r\n    public connectTo(point: ConnectedToT): void {\r\n        if (this._connectionType === point._connectionType) {\r\n            throw new Error(`Cannot connect two points of type ${this.connectionType}`);\r\n        }\r\n        if ((this._isSingularConnection() && this._connectedPoint.length > 0) || (point._isSingularConnection() && point._connectedPoint.length > 0)) {\r\n            throw new Error(\"Max number of connections for point reached\");\r\n        }\r\n        this._connectedPoint.push(point);\r\n        point._connectedPoint.push(this);\r\n    }\r\n\r\n    /**\r\n     * Disconnects two connections.\r\n     * @param point the connection to disconnect from.\r\n     * @param removeFromLocal if true, the connection will be removed from the local connection list.\r\n     */\r\n    public disconnectFrom(point: ConnectedToT, removeFromLocal = true): void {\r\n        const indexLocal = this._connectedPoint.indexOf(point);\r\n        const indexConnected = point._connectedPoint.indexOf(this);\r\n        if (indexLocal === -1 || indexConnected === -1) {\r\n            return;\r","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/FlowGraph/flowGraphConnection.ts#L87-L123","documentation":"Thrown by FlowGraphConnectionPoint.connectTo when both points have the same connection type (e.g. both are inputs or both are outputs). A flow-graph connection must link a point of one direction to a point of the opposite direction, so same-type connections are rejected before any state is mutated.","triggerScenarios":"Calling connectTo() on two FlowGraphConnectionPoints where this._connectionType === point._connectionType, e.g. dataOut.connectTo(otherDataOut) or input.connectTo(otherInput).","commonSituations":"Building graphs programmatically and accidentally wiring an output to an output; misreading the connectTo API as 'attach to any point'; refactoring code where the direction of a point variable changed.","solutions":["Check connectionType (input/output) of both points before connecting and connect opposite directions","Use the block's dataInputs/dataOutputs/signalInputs/signalOutputs accessors to pick the correct counterpart point","Log both points' connectionType when debugging to confirm directions"],"exampleFix":"// before\nblockA.dataOutputs[0].connectTo(blockB.dataOutputs[0]);\n// after\nblockA.dataOutputs[0].connectTo(blockB.dataInputs[0]);","handlingStrategy":"validation","validationCode":"if (a.connectionType === b.connectionType) {\n  throw new Error(`Refusing to connect two ${a.connectionType} points`);\n}\na.connectTo(b);","typeGuard":"function canConnect(a: FlowGraphConnectionPoint, b: FlowGraphConnectionPoint): boolean {\n  return a.connectionType !== b.connectionType;\n}","tryCatchPattern":null,"preventionTips":["Always read connectionType from the point, never assume direction","Use block.dataInputs/dataOutputs accessors instead of raw point arrays","Write graph-building helpers that pair outputs to inputs automatically"],"tags":["flow-graph","babylonjs","invalid-connection","api-misuse"],"backgroundTag":"connection-direction-mismatch","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}