{"record":{"id":"2d72ef507be58d20","repo":"greensock/GSAP","slug":"please-gsap-registerplugin-scrollsmoother","errorCode":null,"errorMessage":"Please gsap.registerPlugin(ScrollSmoother)","messagePattern":"Please gsap\\.registerPlugin\\(ScrollSmoother\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ScrollSmoother.js","lineNumber":48,"sourceCode":"\t\t\tchange += extraChange;\n\t\t}\n\t\treturn {change, offset};\n\t},\n\t_wrap = el => {\n\t\tlet wrapper = _doc.querySelector(\".ScrollSmoother-wrapper\"); // some frameworks load multiple times, so one already exists, just use that to avoid duplicates\n\t\tif (!wrapper) {\n\t\t\twrapper = _doc.createElement(\"div\");\n\t\t\twrapper.classList.add(\"ScrollSmoother-wrapper\");\n\t\t\tel.parentNode.insertBefore(wrapper, el);\n\t\t\twrapper.appendChild(el);\n\t\t}\n\t\treturn wrapper;\n\t};\n\nexport class ScrollSmoother {\n\n\tconstructor(vars) {\n\t\t_coreInitted || ScrollSmoother.register(gsap) || console.warn(\"Please gsap.registerPlugin(ScrollSmoother)\");\n\t\tvars = this.vars = vars || {};\n\n\t\t_mainInstance && _mainInstance.kill();\n\t\t_mainInstance = this;\n\t\t_context(this);\n\n\t\tlet {smoothTouch, onUpdate, onStop, smooth, onFocusIn, normalizeScroll, wholePixels} = vars,\n\t\t\tcontent, wrapper, height, mainST, effects, sections, intervalID, wrapperCSS, contentCSS, paused, pausedNormalizer, recordedRefreshScroll, recordedRefreshScrub, allowUpdates,\n\t\t\tself = this,\n\t\t\teffectsPrefix = vars.effectsPrefix || \"\",\n\t\t\tscrollFunc = ScrollTrigger.getScrollFunc(_win),\n\t\t\tsmoothDuration = ScrollTrigger.isTouch === 1 ? (smoothTouch === true ? 0.8 : parseFloat(smoothTouch) || 0) : (smooth === 0 || smooth === false) ? 0 : parseFloat(smooth) || 0.8,\n\t\t\tspeed = (smoothDuration && +vars.speed) || 1,\n\t\t\tcurrentY = 0,\n\t\t\tdelta = 0,\n\t\t\tstartupPhase = 1,\n\t\t\ttracker = _getVelocityProp(0),\n\t\t\tupdateVelocity = () => tracker.update(-currentY),","sourceCodeStart":30,"sourceCodeEnd":66,"githubUrl":"https://github.com/greensock/GSAP/blob/13e2b790546426a1a2e0e9b409f3f8dc6d6611f2/src/ScrollSmoother.js#L30-L66","documentation":"ScrollSmoother is a members-only GSAP plugin whose constructor checks ScrollSmoother.register(gsap) succeeded (_coreInitted). If registration never happened it warns that gsap.registerPlugin(ScrollSmoother) is required; the instance will not function correctly.","triggerScenarios":"new ScrollSmoother({...}) without calling gsap.registerPlugin(ScrollSmoother) first, or using ScrollSmoother.create without registration, often because the plugin file was never imported or an unregistered/free build was used.","commonSituations":"Importing ScrollSmoother without registration in a bundler setup, loading the plugin script after instantiating, or attempting to use ScrollSmoother with a GSAP package that does not include it (it requires a Club GSAP membership).","solutions":["Call gsap.registerPlugin(ScrollSmoother) before ScrollSmoother.create/new ScrollSmoother","Verify your GSAP license/build actually includes ScrollSmoother (it is a Club GSAP plugin)","Centralize plugin registration in a bootstrap module imported before app code","Check import order so the plugin module is loaded before registration call"],"exampleFix":"// before\nimport { ScrollSmoother } from 'gsap/ScrollSmoother';\nconst smoother = ScrollSmoother.create({ smooth: 1 });\n// after\nimport { gsap } from 'gsap';\nimport { ScrollSmoother } from 'gsap/ScrollSmoother';\ngsap.registerPlugin(ScrollSmoother);\nconst smoother = ScrollSmoother.create({ smooth: 1 });","handlingStrategy":"validation","validationCode":"import { gsap } from 'gsap';\nimport { ScrollSmoother } from 'gsap/ScrollSmoother';\ngsap.registerPlugin(ScrollSmoother);\nif (!gsap.core.globals().ScrollSmoother) throw new Error('ScrollSmoother not registered / not licensed');","typeGuard":null,"tryCatchPattern":"try {\n  const smoother = ScrollSmoother.create(vars);\n} catch (e) {\n  console.error('ScrollSmoother unavailable — verify Club GSAP build and registration', e);\n}","preventionTips":["Confirm your license/build includes ScrollSmoother before using it","Register plugins in a single init module","Match gsap core and plugin versions"],"tags":["gsap","plugin-registration","scrollsmoother"],"backgroundTag":"missing-plugin-registration","analyzedSha":"13e2b790546426a1a2e0e9b409f3f8dc6d6611f2","analyzedAt":"2026-08-29T08:34:05.027Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}