{"record":{"id":"b8584ad10832534b","repo":"greensock/GSAP","slug":"please-gsap-registerplugin-motionpathplugin","errorCode":null,"errorMessage":"Please gsap.registerPlugin(MotionPathPlugin)","messagePattern":"Please gsap\\.registerPlugin\\(MotionPathPlugin\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/MotionPathHelper.js","lineNumber":88,"sourceCode":"\t\t});\n\t},\n\t_identityMatrixObject = {matrix:{a:1, b:0, c:0, d:1, e:0, f:0}},\n\t_getConsolidatedMatrix = target => (target.transform.baseVal.consolidate() || _identityMatrixObject).matrix,\n\t_findMotionPathTween = target => {\n\t\tlet tweens = gsap.getTweensOf(target),\n\t\t\ti = 0;\n\t\tfor (; i < tweens.length; i++) {\n\t\t\tif (tweens[i].vars.motionPath) {\n\t\t\t\treturn tweens[i];\n\t\t\t} else if (tweens[i].timeline) {\n\t\t\t\ttweens.push(...tweens[i].timeline.getChildren());\n\t\t\t}\n\t\t}\n\t},\n\t_initCore = (core, required) => {\n\t\tlet message = \"Please gsap.registerPlugin(MotionPathPlugin)\";\n\t\t_win = window;\n\t\tgsap = gsap || core || _win.gsap || console.warn(message);\n\t\tgsap && PathEditor.register(gsap);\n\t\t_doc = document;\n\t\t_body = _doc.body;\n\t\t_docEl = _doc.documentElement;\n\t\tif (gsap) {\n\t\t\tMotionPathPlugin = gsap.plugins.motionPath;\n\t\t\tMotionPathHelper.PathEditor = PathEditor;\n\t\t\t_context = gsap.core.context || function() {};\n\t\t}\n\t\tif (!MotionPathPlugin) {\n\t\t\t(required === true) && console.warn(message);\n\t\t} else {\n\t\t\t_initCopyToClipboard();\n\t\t\t_arrayToRawPath = MotionPathPlugin.arrayToRawPath;\n\t\t\t_rawPathToString = MotionPathPlugin.rawPathToString;\n\t\t}\n\t};\n","sourceCodeStart":70,"sourceCodeEnd":106,"githubUrl":"https://github.com/greensock/GSAP/blob/13e2b790546426a1a2e0e9b409f3f8dc6d6611f2/src/MotionPathHelper.js#L70-L106","documentation":"MotionPathHelper's core init tries to locate a GSAP instance from its argument, window.gsap, or an existing module-scoped gsap. If none is found it warns that MotionPathPlugin must be registered. This is the general 'gsap not found' branch of _initCore (as opposed to error 17's 'plugin missing' branch).","triggerScenarios":"Loading MotionPathHelper before GSAP core exists on window; instantiating MotionPathHelper without gsap.registerPlugin(MotionPathPlugin) and without any core in scope; passing no core argument in non-window contexts.","commonSituations":"Script tag ordering (helper before gsap); bundler tree-shaking away the core import; using the helper in a worker/SSR context where window is unavailable.","solutions":["Load/import gsap core before MotionPathHelper","Call gsap.registerPlugin(MotionPathPlugin) and register the helper: gsap.registerPlugin(MotionPathHelper) or new MotionPathHelper(...) after core loads","Pass the core explicitly where the API accepts it"],"exampleFix":"<!-- before -->\n<script src=\"MotionPathHelper.min.js\"></script>\n<script src=\"gsap.min.js\"></script>\n<!-- after -->\n<script src=\"gsap.min.js\"></script>\n<script src=\"MotionPathPlugin.min.js\"></script>\n<script src=\"MotionPathHelper.min.js\"></script>","handlingStrategy":"validation","validationCode":"if (!window.gsap) { throw new Error('Load gsap core before MotionPathHelper'); }","typeGuard":"const hasGsapCore = () => typeof window !== 'undefined' && !!window.gsap;","tryCatchPattern":null,"preventionTips":["Enforce script/import order: core, plugins, helpers","Never instantiate helpers at module top-level before core imports resolve","Register MotionPathPlugin alongside the helper at app startup"],"tags":["gsap","plugin-registration","load-order"],"backgroundTag":"missing-gsap-plugin-registration","analyzedSha":"13e2b790546426a1a2e0e9b409f3f8dc6d6611f2","analyzedAt":"2026-08-29T08:34:05.027Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}