{"record":{"id":"5877df6b4c89f401","repo":"BabylonJS/Babylon.js","slug":"cannot-connect-these-two-connectors-source-th","errorCode":null,"errorMessage":"Cannot connect these two connectors. source: \"${this.ownerBlock.name}\".${this.name}, target: \"${connectionPoint.ownerBlock.name}\".${connectionPoint.name}","messagePattern":"Cannot connect these two connectors\\. source: \"(.+?)\"\\.(.+?), target: \"(.+?)\"\\.(.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Materials/Node/nodeMaterialBlockConnectionPoint.ts","lineNumber":614,"sourceCode":"            sourceBlock = otherBlock;\r\n        }\r\n\r\n        if (targetBlock.isAnAncestorOf(sourceBlock)) {\r\n            return NodeMaterialConnectionPointCompatibilityStates.HierarchyIssue;\r\n        }\r\n\r\n        return NodeMaterialConnectionPointCompatibilityStates.Compatible;\r\n    }\r\n\r\n    /**\r\n     * Connect this point to another connection point\r\n     * @param connectionPoint defines the other connection point\r\n     * @param ignoreConstraints defines if the system will ignore connection type constraints (default is false)\r\n     * @returns the current connection point\r\n     */\r\n    public connectTo(connectionPoint: NodeMaterialConnectionPoint, ignoreConstraints = false): NodeMaterialConnectionPoint {\r\n        if (!ignoreConstraints && !this.canConnectTo(connectionPoint)) {\r\n            throw new Error(\r\n                `Cannot connect these two connectors. source: \"${this.ownerBlock.name}\".${this.name}, target: \"${connectionPoint.ownerBlock.name}\".${connectionPoint.name}`\r\n            );\r\n        }\r\n\r\n        this._endpoints.push(connectionPoint);\r\n        connectionPoint._connectedPoint = this;\r\n\r\n        this._enforceAssociatedVariableName = false;\r\n\r\n        this.onConnectionObservable.notifyObservers(connectionPoint);\r\n        connectionPoint.onConnectionObservable.notifyObservers(this);\r\n\r\n        return this;\r\n    }\r\n\r\n    /**\r\n     * Disconnect this point from one of his endpoint\r\n     * @param endpoint defines the other connection point\r","sourceCodeStart":596,"sourceCodeEnd":632,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Materials/Node/nodeMaterialBlockConnectionPoint.ts#L596-L632","documentation":"NodeMaterialConnectionPoint.connectTo validates compatibility via canConnectTo (type, direction, connection constraints). When the connection is invalid and ignoreConstraints is false, it throws with the names of both endpoints so you can identify the offending edge in your node graph.","triggerScenarios":"outputPoint.connectTo(inputPoint) where types mismatch (e.g. Vector3 vs Color3), connecting output to output, connecting to an input that already has a connection, or other constraint violations.","commonSituations":"Programmatic NME graphs where getInputByName returned a wrong-typed point; version changes where a block's point type changed; attempting multiple connections into a single input.","solutions":["Check canConnectTo before connecting; only pass ignoreConstraints=true if you know the connection is safe","Print both points' .type and .name to see the mismatch and pick matching points","Insert a converter/cast block between mismatched points","Disconnect the input's existing connection before reconnecting"],"exampleFix":"// before\nvectorOutput.connectTo(colorInput); // Vector3 -> Color3 mismatch\n// after\nif (vectorOutput.canConnectTo(colorInput)) {\n  vectorOutput.connectTo(colorInput);\n} else {\n  console.warn('Incompatible points; use a converter block');\n}","handlingStrategy":"validation","validationCode":"if (!src.canConnectTo(dst)) {\n  console.warn(`Incompatible points: ${src.name} (${src.type}) -> ${dst.name} (${dst.type})`);\n} else {\n  src.connectTo(dst);\n}","typeGuard":"const isConnected = (p: NodeMaterialConnectionPoint): boolean => p.isConnected;","tryCatchPattern":"try {\n  output.connectTo(input);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Cannot connect these two connectors')) {\n    console.error(e.message); // includes both endpoint names for debugging\n  } else throw e;\n}","preventionTips":["Log point .type on both sides when a connection fails","Insert converter blocks for type mismatches instead of ignoreConstraints=true","Disconnect an input's existing connection before reconnecting"],"tags":["babylonjs","node-material","graph-connection","type-mismatch"],"backgroundTag":"incompatible-node-connection","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}