greensock/GSAP · warning

Please gsap.registerPlugin(Draggable)

Error message

Please gsap.registerPlugin(Draggable)

What it means

Draggable's _initCore could not find a valid gsap core (gsap undefined, or missing registerPlugin/core APIs). Since Draggable is a plugin that patches into gsap, it warns that gsap.registerPlugin(Draggable) is required. `required` limits the warning to actual Draggable instantiation paths.

Source

Thrown at src/Draggable.js:603

				for (let p in _lookup) {
					if (_lookup[p].isPressed) {
						_lookup[p].endDrag();
					}
				}
			});
			gsap = _coreInitted = _getGSAP();
		}
		if (gsap) {
			InertiaPlugin = gsap.plugins.inertia;
			_context = gsap.core.context || function() {};
			_checkPrefix = gsap.utils.checkPrefix;
			_transformProp = _checkPrefix(_transformProp);
			_transformOriginProp = _checkPrefix(_transformOriginProp);
			_toArray = gsap.utils.toArray;
			_getStyleSaver = gsap.core.getStyleSaver;
			_supports3D = !!_checkPrefix("perspective");
		} else if (required) {
			console.warn("Please gsap.registerPlugin(Draggable)");
		}
	};






class EventDispatcher {

	constructor(target) {
		this._listeners = {};
		this.target = target || this;
	}

	addEventListener(type, callback) {
		let list = this._listeners[type] || (this._listeners[type] = []);
		if (!~list.indexOf(callback)) {

View on GitHub (pinned to 13e2b79054)

Solutions

  1. Call gsap.registerPlugin(Draggable) before Draggable.create()
  2. Ensure the gsap core script loads before Draggable
  3. Import consistently: `import { gsap, Draggable } from 'gsap/all'`
  4. Guard drag initialization behind browser checks in SSR

Example fix

// before
import { Draggable } from 'gsap/all';
Draggable.create('.handle');
// after
import { gsap, Draggable } from 'gsap/all';
gsap.registerPlugin(Draggable);
Draggable.create('.handle');
Defensive patterns

Strategy: validation

Validate before calling

if (typeof gsap === 'undefined' || !gsap.registerPlugin) {
  throw new Error('Draggable requires gsap core');
}
gsap.registerPlugin(Draggable);

Type guard

function draggableReady() {
  return typeof gsap !== 'undefined' && typeof Draggable !== 'undefined' && typeof gsap.registerPlugin === 'function';
}

Prevention

When it happens

Trigger: Calling Draggable.create() when gsap was never registered with the plugin; gsap script not loaded or loaded after Draggable; custom gsap build lacking expected utilities; window undefined.

Common situations: Using Draggable from gsap/all but forgetting registerPlugin; script tag ordering in HTML; mixed ESM/UMD gsap copies; SSR rendering a component that creates Draggables.

Related errors


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