{"record":{"id":"160ced8685cdef4e","repo":"BabylonJS/Babylon.js","slug":"context-target-path-invalid-value-channel-t","errorCode":null,"errorMessage":"${context}/target/path: Invalid value (${channel.target.path})","messagePattern":"(.+?)/target/path: Invalid value \\((.+?)\\)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/dev/loaders/src/glTF/2.0/glTFLoader.pure.ts","lineNumber":1888,"sourceCode":"            switch (channelTargetPath) {\r\n                case AnimationChannelTargetPath.TRANSLATION: {\r\n                    properties = GetMappingForKey(\"/nodes/{}/translation\")?.interpolation!;\r\n                    break;\r\n                }\r\n                case AnimationChannelTargetPath.ROTATION: {\r\n                    properties = GetMappingForKey(\"/nodes/{}/rotation\")?.interpolation!;\r\n                    break;\r\n                }\r\n                case AnimationChannelTargetPath.SCALE: {\r\n                    properties = GetMappingForKey(\"/nodes/{}/scale\")?.interpolation!;\r\n                    break;\r\n                }\r\n                case AnimationChannelTargetPath.WEIGHTS: {\r\n                    properties = GetMappingForKey(\"/nodes/{}/weights\")?.interpolation!;\r\n                    break;\r\n                }\r\n                default: {\r\n                    throw new Error(`${context}/target/path: Invalid value (${channel.target.path})`);\r\n                }\r\n            }\r\n            // stay safe\r\n            if (!properties) {\r\n                throw new Error(`${context}/target/path: Could not find interpolation properties for target path (${channel.target.path})`);\r\n            }\r\n\r\n            const targetInfo: IObjectInfo<IInterpolationPropertyInfo[]> = {\r\n                object: targetNode,\r\n                info: properties,\r\n            };\r\n\r\n            return this._loadAnimationChannelFromTargetInfoAsync(context, animationContext, animation, channel, targetInfo, onLoad);\r\n        });\r\n    }\r\n\r\n    /**\r\n     * @hidden\r","sourceCodeStart":1870,"sourceCodeEnd":1906,"githubUrl":"https://github.com/BabylonJS/Babylon.js/blob/0592b347b8a4ee0236089ea86a749cacfdb266d8/packages/dev/loaders/src/glTF/2.0/glTFLoader.pure.ts#L1870-L1906","documentation":"Animation channels target a node property via channel.target.path (translation, rotation, scale, weights). When the path is none of these, the interpolation-mapping switch has no case and throws this error. The glTF spec defines only those four valid paths.","triggerScenarios":"Loading a glTF animation whose channels[i].target.path is an unknown string (typo, custom value, or exporter bug); e.g. path \"position\" instead of \"translation\".","commonSituations":"Hand-written animation JSON, assets converted from other formats (FBX/BVH converters) that map properties incorrectly, or corrupted files.","solutions":["Correct channel.target.path to one of: translation, rotation, scale, weights.","Re-export the animation from the source tool with a compliant exporter.","Delete the offending animation channel if it is unnecessary.","Run glTF-Validator on the asset to catch all path issues at once."],"exampleFix":"// before\n\"channels\": [{ \"sampler\": 0, \"target\": { \"node\": 0, \"path\": \"position\" } }]\n// after\n\"channels\": [{ \"sampler\": 0, \"target\": { \"node\": 0, \"path\": \"translation\" } }]","handlingStrategy":"validation","validationCode":"const VALID_PATHS = [\"translation\", \"rotation\", \"scale\", \"weights\"];\nfor (const ch of gltf.animations?.flatMap(a => a.channels) ?? []) {\n  if (!VALID_PATHS.includes(ch.target.path)) {\n    throw new Error(`Invalid animation target path: ${ch.target.path}`);\n  }\n}","typeGuard":"function isValidTargetPath(p: string): p is \"translation\" | \"rotation\" | \"scale\" | \"weights\" {\n  return [\"translation\", \"rotation\", \"scale\", \"weights\"].includes(p);\n}","tryCatchPattern":"try { await loadAsset(); } catch (e) {\n  if (/Invalid value \\(/.test((e as Error).message) && /target\\/path/.test((e as Error).message)) {\n    // load without animations or fix the asset\n  }\n}","preventionTips":["Sanitize animations in your asset pipeline (only the 4 spec paths).","Test converter output with glTF-Validator.","Keep animations retargeted together with the meshes they animate."],"tags":["gltf","animation","enum-validation","asset-loading"],"backgroundTag":"invalid-enum-value","analyzedSha":"0592b347b8a4ee0236089ea86a749cacfdb266d8","analyzedAt":"2026-08-30T15:11:20.442Z","schemaVersion":2},"datasetVersion":"2026-08-30T18:17:15.746Z"}