{"record":{"id":"0890cd7a29138546","repo":"mrdoob/three.js","slug":"three-keyframetrack-unsupported-typename-typen","errorCode":null,"errorMessage":"THREE.KeyframeTrack: Unsupported typeName: ${typeName}","messagePattern":"THREE\\.KeyframeTrack: Unsupported typeName: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/animation/AnimationClip.js","lineNumber":450,"sourceCode":"\n\t\t\treturn ColorKeyframeTrack;\n\n\t\tcase 'quaternion':\n\n\t\t\treturn QuaternionKeyframeTrack;\n\n\t\tcase 'bool':\n\t\tcase 'boolean':\n\n\t\t\treturn BooleanKeyframeTrack;\n\n\t\tcase 'string':\n\n\t\t\treturn StringKeyframeTrack;\n\n\t}\n\n\tthrow new Error( 'THREE.KeyframeTrack: Unsupported typeName: ' + typeName );\n\n}\n\nfunction parseKeyframeTrack( json ) {\n\n\tif ( json.type === undefined ) {\n\n\t\tthrow new Error( 'THREE.KeyframeTrack: track type undefined, can not parse' );\n\n\t}\n\n\tconst trackType = getTrackTypeForValueTypeName( json.type );\n\n\tif ( json.times === undefined ) {\n\n\t\tconst times = [], values = [];\n\n\t\tAnimationUtils.flattenJSON( json.keys, times, values, 'value' );","sourceCodeStart":432,"sourceCodeEnd":468,"githubUrl":"https://github.com/mrdoob/three.js/blob/da05705fa31f02710c19772a2aa70c7454807f0c/src/animation/AnimationClip.js#L432-L468","documentation":"Thrown by AnimationUtils/AnimationClip.getTrackTypeForValueTypeName() when parsing an AnimationClip from JSON: each track's 'type' field (compared case-insensitively) must be one of the recognized value-type names — scalar/double/float/number/integer, vector/vector2-4, color, quaternion, bool/boolean, string. Any other value has no KeyframeTrack subclass to map to and aborts clip parsing.","triggerScenarios":"Loading a glTF/JSON animation where a track's .type is a custom or misspelled string. Hand-built AnimationClip JSON whose type field uses a different vocabulary (e.g. 'matrix', 'euler', 'angle'). A version skew where a newer exporter writes a type name this build of three.js does not know.","commonSituations":"Interchanging animation JSON between three.js versions or between three.js and another tool's exporter. Typo in a serialized clip (e.g. 'Vectr3'). Custom track types from an in-house pipeline.","solutions":["Inspect each track.type in the failing clip JSON and correct it to a supported value-type name (scalar, vector3, quaternion, color, bool, string, etc.).","If the type is genuinely new to your pipeline, map it to the closest existing KeyframeTrack subclass (or register a custom track and extend getTrackTypeForValueTypeName).","Re-export the animation from a three.js version matching the runtime library to avoid vocabulary drift."],"exampleFix":"// before — clip JSON track\n{ \"name\": \"arm.rotation\", \"type\": \"euler\", \"times\": [...], \"values\": [...] }\n// -> 'Unsupported typeName: euler'\n\n// after — map to a supported value type\n{ \"name\": \"arm.rotation\", \"type\": \"quaternion\", \"times\": [...], \"values\": [...] }","handlingStrategy":"validation","validationCode":"const VALUE_TYPES = new Set( [ 'scalar', 'double', 'float', 'number', 'integer', 'vector', 'vector2', 'vector3', 'vector4', 'color', 'quaternion', 'bool', 'boolean', 'string' ] );\nfunction validateClipTypes( clipJson ) {\n  for ( const t of clipJson.tracks || [] ) {\n    if ( ! t.type || ! VALUE_TYPES.has( String( t.type ).toLowerCase() ) ) {\n      throw new Error( `track '${t.name}' has unsupported type: ${t.type}` );\n    }\n  }\n}","typeGuard":"const VALUE_TYPES = new Set( [ 'scalar', 'double', 'float', 'number', 'integer', 'vector', 'vector2', 'vector3', 'vector4', 'color', 'quaternion', 'bool', 'boolean', 'string' ] );\nfunction isSupportedValueType( type ) {\n  return typeof type === 'string' && VALUE_TYPES.has( type.toLowerCase() );\n}","tryCatchPattern":"try {\n  clip = AnimationClip.parse( json );\n} catch ( err ) {\n  if ( /Unsupported typeName/.test( err.message ) ) {\n    console.error( 'Animation clip has an unsupported track type; skipping clip.', json );\n    clip = null;\n  } else throw err;\n}","preventionTips":["Use AnimationClip.parse on JSON exported by a matching three.js version.","Validate every track.type against the supported value-type names before parsing.","Map custom value types to the closest built-in KeyframeTrack subclass."],"tags":["animation","keyframe","json","parsing","switch-enum"],"backgroundTag":null,"analyzedSha":"da05705fa31f02710c19772a2aa70c7454807f0c","analyzedAt":"2026-08-12T22:51:37.160Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}