{"record":{"id":"795e135653b8ea50","repo":"mrdoob/three.js","slug":"three-nodeutils-unsupported-type-type","errorCode":null,"errorMessage":"THREE.NodeUtils: Unsupported type: ${type}","messagePattern":"THREE\\.NodeUtils: Unsupported type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/nodes/core/NodeUtils.js","lineNumber":151,"sourceCode":"\n\t\t// Handle int vectors\n\t\tif ( type.startsWith( 'ivec' ) ) return Int32Array;\n\t\t// Handle uint vectors\n\t\tif ( type.startsWith( 'uvec' ) ) return Uint32Array;\n\t\t// Default to float vectors\n\t\treturn Float32Array;\n\n\t}\n\n\t// Handle matrices (always float)\n\tif ( /mat\\d/.test( type ) ) return Float32Array;\n\n\t// Basic types\n\tif ( /float/.test( type ) ) return Float32Array;\n\tif ( /uint/.test( type ) ) return Uint32Array;\n\tif ( /int/.test( type ) ) return Int32Array;\n\n\tthrow new Error( `THREE.NodeUtils: Unsupported type: ${type}` );\n\n}\n\n/**\n * Returns the length for the given data type.\n *\n * @private\n * @method\n * @param {string} type - The data type.\n * @return {number} The length.\n */\nexport function getLengthFromType( type ) {\n\n\tif ( /float|int|uint|bool/.test( type ) ) return 1;\n\tif ( /vec2/.test( type ) ) return 2;\n\tif ( /vec3/.test( type ) ) return 3;\n\tif ( /vec4/.test( type ) ) return 4;\n\tif ( /mat2/.test( type ) ) return 4;","sourceCodeStart":133,"sourceCodeEnd":169,"githubUrl":"https://github.com/mrdoob/three.js/blob/da05705fa31f02710c19772a2aa70c7454807f0c/src/nodes/core/NodeUtils.js#L133-L169","documentation":"Thrown by NodeUtils.getTypedArrayFromType() when the type string does not match vec/ivec/uvec, mat, float, uint, or int patterns. The function picks the JS typed array (Float32Array/Int32Array/Uint32Array) backing a node's data, so an unrecognized type has no array representation.","triggerScenarios":"Passing a type like 'bool', a struct name, an array type, an empty string, or a custom type string to code that resolves a typed array; a node reporting an unregistered type during buffer/attribute allocation.","commonSituations":"Custom node types not following the vec/mat/scalar naming convention; corrupt or empty type strings from failed type inference; older/newer type naming mismatch across versions.","solutions":["Use a recognized primitive type string (float, int, uint, vecN, ivecN, uvecN, matN).","Fix the upstream node so getNodeType() returns a valid type instead of null/empty/custom.","For boolean/struct data, encode it as uint/int."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"function resolveTypedArray( type ) {\n  if ( /[iu]?vec\\d/.test( type ) ) return type.startsWith( 'ivec' ) ? Int32Array : type.startsWith( 'uvec' ) ? Uint32Array : Float32Array;\n  if ( /mat\\d/.test( type ) ) return Float32Array;\n  if ( /float/.test( type ) ) return Float32Array;\n  if ( /uint/.test( type ) ) return Uint32Array;\n  if ( /int/.test( type ) ) return Int32Array;\n  throw new TypeError( `Unsupported type: ${ type }` );\n}","typeGuard":"const isResolvableArrayType = ( t ) => /[iu]?vec\\d|mat\\d|float|uint|int/.test( t );","tryCatchPattern":null,"preventionTips":["Stick to recognized vec/mat/scalar type strings.","Ensure custom nodes report a valid type from getNodeType().","Encode bool/struct data as uint/int."],"tags":["node-utils","type-system","typed-array"],"backgroundTag":null,"analyzedSha":"da05705fa31f02710c19772a2aa70c7454807f0c","analyzedAt":"2026-08-12T22:51:37.160Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}