{"record":{"id":"8105a64705641460","repo":"BabylonJS/Babylon.js","slug":"auto-bound-input-autoboundinput-name-has-an-uns","errorCode":null,"errorMessage":"Auto bound input ${autoBoundInput.name} has an unsupported type or auto bind value","messagePattern":"Auto bound input (.+?) has an unsupported type or auto bind value","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/dev/smartFilters/src/blockFoundation/customShaderBlock.ts","lineNumber":303,"sourceCode":"                type: input.type,\r\n                runtimeData: this._confirmRuntimeDataSupplied(input),\r\n                autoBind: undefined,\r\n            };\r\n        });\r\n\r\n        if (this._autoBoundInputs) {\r\n            for (const autoBoundInput of this._autoBoundInputs) {\r\n                if (\r\n                    (autoBoundInput.autoBind === \"outputResolution\" && autoBoundInput.type == ConnectionPointType.Vector2) ||\r\n                    (autoBoundInput.autoBind === \"outputAspectRatio\" && autoBoundInput.type == ConnectionPointType.Vector2)\r\n                ) {\r\n                    inputsToBind.push({\r\n                        name: autoBoundInput.name,\r\n                        type: autoBoundInput.type,\r\n                        autoBind: autoBoundInput.autoBind,\r\n                    });\r\n                } else {\r\n                    throw new Error(`Auto bound input ${autoBoundInput.name} has an unsupported type or auto bind value`);\r\n                }\r\n            }\r\n        }\r\n\r\n        return new CustomShaderBlockBinding(inputsToBind);\r\n    }\r\n\r\n    /**\r\n     * Validates the default value of a connection point and returns it if valid.\r\n     * If the default value is not provided or is invalid, this returns null.\r\n     * @param connectionPointType - The type of the connection point\r\n     * @param connectionPointName - The name of the connection point\r\n     * @param defaultValue - The default value of the connection point\r\n     * @returns The default value, or null if no default value is provided or it was invalid\r\n     */\r\n    private _validateDefaultValue<U extends ConnectionPointType>(\r\n        connectionPointType: U,\r\n        connectionPointName: string,\r","sourceCodeStart":285,"sourceCodeEnd":321,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/smartFilters/src/blockFoundation/customShaderBlock.ts#L285-L321","documentation":"During getShaderBinding, CustomShaderBlock iterates inputs flagged as auto-bound and maps each (type, autoBind) pair to a binding. A pair the mapping table doesn't recognize — an unexpected connection point type combined with that autoBind mode — cannot be translated to a shader binding, so it throws.","triggerScenarios":"Declaring an auto-bound input whose type/autoBind combination is not supported by the binding switch in getShaderBinding, e.g. a newly added ConnectionPointType or autoBind enum value not yet handled, or a block definition JSON with a mistyped autoBind value.","commonSituations":"Custom shader block definitions authored by hand with an invalid autoBind string/number; upgrading the library so a previously accepted combination changed; adding a new connection point type without extending the binding code.","solutions":["Check the input's type and autoBind values against the supported combinations in getShaderBinding and correct the block definition.","Update to a library version that supports the type/autoBind pair you need.","Remove the autoBind flag from the offending input and bind it manually via inputsToBind.","If you added a new ConnectionPointType or autoBind mode, extend the binding switch in customShaderBlock.ts to handle it."],"exampleFix":"// before\n{ \"name\": \"time\", \"type\": \"Texture\", \"autoBind\": \"time\" }\n// after\n{ \"name\": \"time\", \"type\": \"Float\", \"autoBind\": \"time\" }","handlingStrategy":"validation","validationCode":"const SUPPORTED_AUTO_BINDS = new Set([/* supported (type, autoBind) combos */]);\nfor (const input of blockDef.inputs) {\n    if (input.autoBind && !SUPPORTED_AUTO_BINDS.has(`${input.type}:${input.autoBind}`)) {\n        throw new Error(`unsupported autoBind '${input.autoBind}' for type '${input.type}' on '${input.name}'`);\n    }\n}","typeGuard":"function hasSupportedAutoBind(input: { type: ConnectionPointType; autoBind?: string }): boolean {\n    return !input.autoBind || SUPPORTED_AUTO_BINDS.has(`${input.type}:${input.autoBind}`);\n}","tryCatchPattern":"try {\n    const binding = block.getShaderBinding();\n} catch (e) {\n    if (e instanceof Error && e.message.startsWith('Auto bound input')) {\n        // fix or remove the autoBind on the named input\n    } else throw e;\n}","preventionTips":["Keep block definition JSON autoBind values in sync with getShaderBinding's supported set.","Validate custom shader block definitions against the supported type/autoBind matrix at load time.","When adding a new ConnectionPointType or autoBind mode, extend the binding switch and its tests."],"tags":["smart-filters","shader-binding","unsupported-value"],"backgroundTag":"unsupported-binding-type","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}