greensock/GSAP · error

Requires GSAP 3.11.0 or later

Error message

Requires GSAP 3.11.0 or later

What it means

ScrollTrigger's _initCore uses features added in GSAP 3.11.0 (e.g., gsap.matchMedia used for ignoreMobileResize). When the installed gsap core version is older it warns "Requires GSAP 3.11.0 or later" and skips that setup, so some features will not work.

Source

Thrown at src/ScrollTrigger.js:1381

						let mm = gsap.matchMedia(),
							p;
						for (p in vars) {
							mm.add(p, vars[p]);
						}
						return mm;
					};
					gsap.addEventListener("matchMediaInit", () => { _recordScrollPositions(); _revertAll(); });
					gsap.addEventListener("matchMediaRevert", () => _revertRecorded());
					gsap.addEventListener("matchMedia", () => {
						_refreshAll(0, 1);
						_dispatch("matchMedia");
					});
					gsap.matchMedia().add("(orientation: portrait)", () => { // when orientation changes, we should take new base measurements for the ignoreMobileResize feature.
						_setBaseDimensions();
						return _setBaseDimensions;
					});
				} else {
					console.warn("Requires GSAP 3.11.0 or later");
				}
				_setBaseDimensions();
				_addListener(_doc, "scroll", _onScroll); // some browsers (like Chrome), the window stops dispatching scroll events on the window if you scroll really fast, but it's consistent on the document!
				let bodyHasStyle = _body.hasAttribute("style"),
					bodyStyle = _body.style,
					border = bodyStyle.borderTopStyle,
					AnimationProto = gsap.core.Animation.prototype,
					bounds, i;
				AnimationProto.revert || Object.defineProperty(AnimationProto, "revert", { value: function() { return this.time(-0.01, true); }}); // only for backwards compatibility (Animation.revert() was added after 3.10.4)
				bodyStyle.borderTopStyle = "solid"; // works around an issue where a margin of a child element could throw off the bounds of the _body, making it seem like there's a margin when there actually isn't. The border ensures that the bounds are accurate.
				bounds = _getBounds(_body);
				_vertical.m = Math.round(bounds.top + _vertical.sc()) || 0; // accommodate the offset of the <body> caused by margins and/or padding
				_horizontal.m = Math.round(bounds.left + _horizontal.sc()) || 0;
				border ? (bodyStyle.borderTopStyle = border) : bodyStyle.removeProperty("border-top-style");
				if (!bodyHasStyle) { // SSR frameworks like Next.js complain if this attribute gets added.
					_body.setAttribute("style", ""); // it's not enough to just removeAttribute() - we must first set it to empty, otherwise Next.js complains.
					_body.removeAttribute("style");
				}

View on GitHub (pinned to 13e2b79054)

Solutions

  1. Upgrade gsap core to >= 3.11.0 (npm i gsap@latest) so core and plugin versions match
  2. Update all CDN script tags to the same recent GSAP version
  3. Clear the package-lock/cache and reinstall to remove the stale version
  4. Audit that no locally-vendored plugin files come from an older release

Example fix

// before
<script src="https://cdn.jsdelivr.net/npm/gsap@3.10.0/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12/dist/ScrollTrigger.min.js"></script>
// after
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12/dist/gsap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/gsap@3.12/dist/ScrollTrigger.min.js"></script>
Defensive patterns

Strategy: validation

Validate before calling

import { gsap } from 'gsap';
import { ScrollTrigger } from 'gsap/ScrollTrigger';
const v = parseInt(gsap.version, 10);
if (!(v > 3 || (v === 3 && parseFloat(gsap.version.split('.').slice(1).join('.')) >= 11))) {
  throw new Error(`ScrollTrigger requires GSAP >= 3.11.0, found ${gsap.version}`);
}

Prevention

When it happens

Trigger: Loading a recent ScrollTrigger build alongside an older gsap core (< 3.11.0) — e.g., a cached CDN gsap.min.js, a pinned old npm version, or mixed plugin files from different GSAP releases.

Common situations: Upgrading ScrollTrigger.js manually without updating gsap.min.js, package-lock pinning old gsap, CDN URL pinned to 3.10.x, or copying plugin files from different versions into a project.

Related errors


AI-assisted analysis of greensock/GSAP@13e2b79054 (2026-08-29). Data as JSON: /api/errors/743876af2619edbc. Report an issue: GitHub.