{"record":{"id":"3e944c608864fc24","repo":"greensock/GSAP","slug":"error-no-velocity-was-defined-for-target-prope","errorCode":null,"errorMessage":"ERROR: No velocity was defined for ${target} property: ${p}","messagePattern":"ERROR: No velocity was defined for (.+?) property: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"src/InertiaPlugin.js","lineNumber":276,"sourceCode":"\t\t\tp, curProp, curVal, unit, velocity, change1, end, change2, linkedProps;\n\t\tvars = _processingVars;\n\t\t_processingVars = 0;\n\t\t//when there are linkedProps (typically \"x,y\" where snapping has to factor in multiple properties, we must first populate an object with all of those end values, then feed it to the function that make any necessary alterations. So the point of this first loop is to simply build an object (like {x:100, y:204.5}) for feeding into that function which we'll do later in the \"real\" loop.\n\t\tlinkedProps = _processLinkedProps(target, vars, getVal, resistance);\n\n\t\tfor (p in vars) {\n\t\t\tif (!_reservedProps[p]) {\n\t\t\t\tcurProp = vars[p];\n\t\t\t\t_isFunction(curProp) && (curProp = curProp(index, target, targets));\n\t\t\t\tif (_isNumber(curProp)) {\n\t\t\t\t\tvelocity = curProp;\n\t\t\t\t} else if (_isObject(curProp) && !isNaN(curProp.velocity)) {\n\t\t\t\t\tvelocity = +curProp.velocity;\n\t\t\t\t} else {\n\t\t\t\t\tif (tracker && tracker.isTracking(p)) {\n\t\t\t\t\t\tvelocity = tracker.get(p);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tconsole.warn(\"ERROR: No velocity was defined for \" + target + \" property: \" + p);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tchange1 = _calculateChange(velocity, duration);\n\t\t\t\tchange2 = 0;\n\t\t\t\tcurVal = getVal(target, p);\n\t\t\t\tunit = _getUnit(curVal);\n\t\t\t\tcurVal = parseFloat(curVal);\n\t\t\t\tif (_isObject(curProp)) {\n\t\t\t\t\tend = curVal + change1;\n\t\t\t\t\tif (\"end\" in curProp) {\n\t\t\t\t\t\tcurProp = _parseEnd(curProp, (linkedProps && p in linkedProps) ? linkedProps : end, curProp.max, curProp.min, p, vars.radius, velocity);\n\t\t\t\t\t}\n\t\t\t\t\tif ((\"max\" in curProp) && +curProp.max < end) {\n\t\t\t\t\t\tif (preventOvershoot || curProp.preventOvershoot) {\n\t\t\t\t\t\t\tchange1 = curProp.max - curVal;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tchange2 = (curProp.max - curVal) - change1;\n\t\t\t\t\t\t}","sourceCodeStart":258,"sourceCodeEnd":294,"githubUrl":"https://github.com/greensock/GSAP/blob/13e2b790546426a1a2e0e9b409f3f8dc6d6611f2/src/InertiaPlugin.js#L258-L294","documentation":"When building an inertia tween, each property needs a starting velocity. It can come from an explicit velocity value in vars or from live tracking data. If neither exists for a property, InertiaPlugin warns that no velocity was defined for that target/property and continues with undefined behavior for that property.","triggerScenarios":"gsap.to(el, {inertia:{x:{end:500}}}) where neither a velocity nor InertiaPlugin tracking provides x's velocity; using property names that differ from the tracked ones (e.g. tracking x but tweening left).","commonSituations":"Hand-written inertia configs omitting velocity; transformed properties tracked under different names than the tween props; Draggable's tracking thrown away before the throw tween runs.","solutions":["Provide velocity explicitly: inertia:{x:{velocity:500, end:1000}}","Call InertiaPlugin.track(target) and ensure isTracking(p) for each inertia property","Use Draggable with inertia:true so tracking/throwing is wired automatically","Match property names between track() and the inertia vars"],"exampleFix":"// before\ngsap.to(el, { inertia: { x: { end: 300 } } }); // no velocity source\n// after\nInertiaPlugin.track(el);\ngsap.to(el, { inertia: { x: { velocity: \"auto\", end: 300 } } });\n// or explicit:\ngsap.to(el, { inertia: { x: { velocity: 400, end: 300 } } });","handlingStrategy":"validation","validationCode":"Object.keys(inertiaVars).forEach(p => { const prop = inertiaVars[p]; if (!(typeof prop === 'object' && !isNaN(prop.velocity)) && !InertiaPlugin.getByTarget?.(target)?.isTracking?.(p)) { console.warn('No velocity for ' + p); } });","typeGuard":"const hasVelocitySource = (target, p, curProp) => (curProp && typeof curProp === 'object' && !isNaN(curProp.velocity)) || InertiaPlugin.track && !!tracker;","tryCatchPattern":null,"preventionTips":["Always supply velocity explicitly when not relying on tracking","Keep tracked property names identical to tweened property names","Track the target right before the throw/inertia tween executes"],"tags":["gsap","inertia","velocity"],"backgroundTag":"missing-velocity-in-inertia","analyzedSha":"13e2b790546426a1a2e0e9b409f3f8dc6d6611f2","analyzedAt":"2026-08-29T08:34:05.027Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}