{"record":{"id":"132d193bb1fdc0bc","repo":"BabylonJS/Babylon.js","slug":"unable-to-find-a-compatible-match","errorCode":null,"errorMessage":"Unable to find a compatible match","messagePattern":"Unable to find a compatible match","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/core/src/Materials/Node/nodeMaterialBlock.ts","lineNumber":466,"sourceCode":"            output?: string;\r\n            outputSwizzle?: string;\r\n        }\r\n    ) {\r\n        if (this._outputs.length === 0) {\r\n            return;\r\n        }\r\n\r\n        let output = options && options.output ? this.getOutputByName(options.output) : this.getFirstAvailableOutput(other);\r\n\r\n        let notFound = true;\r\n        while (notFound) {\r\n            const input = options && options.input ? other.getInputByName(options.input) : other.getFirstAvailableInput(output);\r\n\r\n            if (output && input && output.canConnectTo(input)) {\r\n                output.connectTo(input);\r\n                notFound = false;\r\n            } else if (!output) {\r\n                throw new Error(\"Unable to find a compatible match\");\r\n            } else {\r\n                output = this.getSiblingOutput(output);\r\n            }\r\n        }\r\n\r\n        return this;\r\n    }\r\n\r\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n    protected _buildBlock(state: NodeMaterialBuildState) {\r\n        // Empty. Must be defined by child nodes\r\n    }\r\n\r\n    // eslint-disable-next-line @typescript-eslint/no-unused-vars\r\n    protected _postBuildBlock(state: NodeMaterialBuildState) {\r\n        // Empty. Must be defined by child nodes\r\n    }\r\n\r","sourceCodeStart":448,"sourceCodeEnd":484,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/core/src/Materials/Node/nodeMaterialBlock.ts#L448-L484","documentation":"NodeMaterialBlock.connectTo tries to auto-match an output of this block to an input of the other block. If at some step no output remains to try (output became null after consuming all sibling outputs), it throws — the blocks have no connectable point pair.","triggerScenarios":"blockA.connectTo(blockB) where all of A's outputs are already connected or none can drive any of B's inputs; traversal walks all sibling outputs without finding a canConnectTo match.","commonSituations":"Chaining blocks with incompatible point types; blocks whose outputs were already consumed; misremembering block connection capabilities vs. the NME graph.","solutions":["Connect explicitly: a.getOutputByName('xyz').connectTo(b.getInputByName('target'))","Verify the blocks have compatible connection types (check canConnectTo / point types)","Ensure the source output isn't already connected; use a new block instance or disconnect first"],"exampleFix":"// before\ntransform.connectTo(vertexOutput); // no compatible free output\n// after\n// correct chain: transform -> fragment output -> vertex output\ntransform.getOutputByName('vector').connectTo(fragmentOutput.getInputByName('worldPosition'));\nfragmentOutput.connectTo(vertexOutput);","handlingStrategy":"type-guard","validationCode":"const out = a.getOutputByName('output');\nconst inp = b.getInputByName('input');\nif (!out || !inp || !out.canConnectTo(inp)) throw new Error(`Cannot connect ${a.name} -> ${b.name}`);\nout.connectTo(inp);","typeGuard":"const connectable = (out: NodeMaterialConnectionPoint | null, inp: NodeMaterialConnectionPoint | null): out is NodeMaterialConnectionPoint =>\n  out !== null && inp !== null && out.canConnectTo(inp);","tryCatchPattern":"try {\n  blockA.connectTo(blockB);\n} catch (e) {\n  if (e instanceof Error && e.message.includes('Unable to find a compatible match')) {\n    console.error('No compatible connection between', blockA.name, 'and', blockB.name);\n  } else throw e;\n}","preventionTips":["Prefer explicit output.connectTo(input) over auto-matching connectTo(block)","Check canConnectTo before wiring blocks of unfamiliar types","Verify source outputs are not already fully connected"],"tags":["babylonjs","node-material","graph-connection"],"backgroundTag":"incompatible-node-connection","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}