{"record":{"id":"472f37b902e1a91c","repo":"greensock/GSAP","slug":"please-gsap-registerplugin-motionpathplugin-472f37","errorCode":null,"errorMessage":"Please gsap.registerPlugin(MotionPathPlugin)","messagePattern":"Please gsap\\.registerPlugin\\(MotionPathPlugin\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/MotionPathPlugin.js","lineNumber":169,"sourceCode":"\t\tplugin._props.push(prop);\n\t},\n\t_sliceModifier = (start, end) => rawPath => (start || end !== 1) ? sliceRawPath(rawPath, start, end) : rawPath;\n\n\nexport const MotionPathPlugin = {\n\tversion: \"3.15.0\",\n\tname: \"motionPath\",\n\tregister(core, Plugin, propTween) {\n\t\tgsap = core;\n\t\t_getUnit = gsap.utils.getUnit;\n\t\t_toArray = gsap.utils.toArray;\n\t\t_getStyleSaver = gsap.core.getStyleSaver;\n\t\t_reverting = gsap.core.reverting || function() {};\n\t\tPropTween = propTween;\n\t},\n\tinit(target, vars, tween) {\n\t\tif (!gsap) {\n\t\t\tconsole.warn(\"Please gsap.registerPlugin(MotionPathPlugin)\");\n\t\t\treturn false;\n\t\t}\n\t\tif (!(typeof(vars) === \"object\" && !vars.style) || !vars.path) {\n\t\t\tvars = {path:vars};\n\t\t}\n\t\tlet rawPaths = [],\n\t\t\t{path, autoRotate, unitX, unitY, x, y} = vars,\n\t\t\tfirstObj = path[0],\n\t\t\tslicer = _sliceModifier(vars.start, (\"end\" in vars) ? vars.end : 1),\n\t\t\trawPath, p;\n\t\tthis.rawPaths = rawPaths;\n\t\tthis.target = target;\n\t\tthis.tween = tween;\n\t\tthis.styles = _getStyleSaver && _getStyleSaver(target, \"transform\");\n\t\tif ((this.rotate = (autoRotate || autoRotate === 0))) { //get the rotational data FIRST so that the setTransform() method is called in the correct order in the render() loop - rotation gets set last.\n\t\t\tthis.rOffset = parseFloat(autoRotate) || 0;\n\t\t\tthis.radians = !!vars.useRadians;\n\t\t\tthis.rProp = vars.rotation || \"rotation\";                       // rotation property","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/greensock/GSAP/blob/13e2b790546426a1a2e0e9b409f3f8dc6d6611f2/src/MotionPathPlugin.js#L151-L187","documentation":"MotionPathPlugin's init requires the module-scoped gsap reference set during registration. If a tween uses motionPath before the plugin was registered with gsap.registerPlugin(MotionPathPlugin), init warns and returns false, so the tween renders without motion-path behavior.","triggerScenarios":"gsap.to(el, {motionPath:...}) before gsap.registerPlugin(MotionPathPlugin); dynamically building tweens in code that runs before plugin registration completes; motionPath tween inside a function invoked at import time.","commonSituations":"Missing registerPlugin after switching to npm/ESM imports; deferred tween creation racing plugin setup; tree-shaken import that never executes registration.","solutions":["Call gsap.registerPlugin(MotionPathPlugin) before creating any motionPath tweens","Register synchronously at app entry point before scheduling animations","Verify registration by checking gsap.plugins.motionPath"],"exampleFix":"// before\nimport { gsap } from 'gsap';\nimport { MotionPathPlugin } from 'gsap/MotionPathPlugin';\ngsap.to(el, { motionPath: { path: '#curve' } }); // not registered\n// after\nimport { gsap } from 'gsap';\nimport { MotionPathPlugin } from 'gsap/MotionPathPlugin';\ngsap.registerPlugin(MotionPathPlugin);\ngsap.to(el, { motionPath: { path: '#curve' } });","handlingStrategy":"validation","validationCode":"if (!gsap.plugins.motionPath) gsap.registerPlugin(MotionPathPlugin);","typeGuard":"const canTweenMotionPath = () => typeof gsap !== 'undefined' && !!gsap.plugins?.motionPath;","tryCatchPattern":null,"preventionTips":["Register all plugins synchronously in the app entry point","Avoid creating tweens inside module initializers that may run before registration","Add a shared setup module that registers every plugin used in the project"],"tags":["gsap","motionpath","plugin-registration"],"backgroundTag":"missing-gsap-plugin-registration","analyzedSha":"13e2b790546426a1a2e0e9b409f3f8dc6d6611f2","analyzedAt":"2026-08-29T08:34:05.027Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}