{"record":{"id":"ba82c9edd7520a7d","repo":"greensock/GSAP","slug":"please-gsap-registerplugin-gsdevtools","errorCode":null,"errorMessage":"Please gsap.registerPlugin(GSDevTools)","messagePattern":"Please gsap\\.registerPlugin\\(GSDevTools\\)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/GSDevTools.js","lineNumber":369,"sourceCode":"\t\t\t}\n\t\t}\n\t},\n\t_checkIndependence = (animation, vars) => {\n\t\tif (!vars.globalSync && animation.parent !== _globalTimeline) { //in case it's nested in a timeline (playing it won't help if the parent timeline isn't playing).\n\t\t\t_globalTimeline.add(animation, _globalTimeline.time());\n\t\t}\n\t},\n\n\n\n\n\n\n\n\tGSDevTools = function(vars) {\n\t\tif (!_coreInitted) {\n\t\t\t_initCore();\n\t\t\tgsap || console.warn(\"Please gsap.registerPlugin(GSDevTools)\");\n\t\t}\n\n\t\tthis.vars = vars = vars || {};\n\t\tif (vars.animation) {\n\t\t\t(GSDevTools.getByAnimation(vars.animation) || {kill:() => 0}).kill();\n\t\t}\n\t\tvars.id = vars.id || (_isString(vars.animation) ? vars.animation : _idSeed++); //try to find a unique ID so that sessionStorage can be mapped to it (otherwise, for example, all the embedded codepens on a page would share the same settings). So if no id is defined, see if there's a string-based \"animation\" defined. Last of all, we default to a numeric counter that we increment.\n\t\t_lookup[vars.id + \"\"] = this;\n\n\t\t(\"globalSync\" in vars) || (vars.globalSync = !vars.animation); //if the user calls create() and passes in an animation AFTER the initial recording time has elapsed, there's a good chance the animation won't be in the recordedRoot, so we change the default globalSync to false because that's the most intuitive behavior.\n\n\t\t//GENERAL/UTILITY\n\t\tlet _self = this,\n\t\t\troot = _createRootElement(vars.container, vars.minimal, vars.css),\n\t\t\tfind = s => root.querySelector(s),\n\t\t\trecord = (key, value) => {\n\t\t\t\tif (vars.persist !== false && _supportsStorage) {\n\t\t\t\t\tsessionStorage.setItem(\"gs-dev-\" + key + vars.id, value);","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/greensock/GSAP/blob/13e2b790546426a1a2e0e9b409f3f8dc6d6611f2/src/GSDevTools.js#L351-L387","documentation":"GSDevTools needs the core GSAP library registered before it can initialize. When the constructor runs and the internal core init cannot find a gsap instance, it warns that you must call gsap.registerPlugin(GSDevTools). This registration step hands the tool its GSAP core reference and triggers _initCore().","triggerScenarios":"Calling new GSDevTools() (or GSDevTools.create()) without ever calling gsap.registerPlugin(GSDevTools), or calling it before gsap is available on window (script load-order issue in non-module environments).","commonSituations":"Loading GSDevTools.min.js without loading a compatible GSAP core first; forgetting the registerPlugin call after migrating to module imports; using GSDevTools in an environment where window.gsap is not set.","solutions":["Call gsap.registerPlugin(GSDevTools) before creating the tool","Ensure gsap core is loaded/imported before GSDevTools","With module imports: import { gsap } from 'gsap'; import { GSDevTools } from 'gsap/GSDevTools'; gsap.registerPlugin(GSDevTools);"],"exampleFix":"// before\nconst devTools = new GSDevTools({ animation: tl });\n// after\nimport { gsap } from 'gsap';\nimport { GSDevTools } from 'gsap/GSDevTools';\ngsap.registerPlugin(GSDevTools);\nconst devTools = GSDevTools.create({ animation: tl });","handlingStrategy":"validation","validationCode":"if (!window.gsap || !gsap.plugins || !gsap.plugins.devTools) { gsap.registerPlugin(GSDevTools); }","typeGuard":"const isGsapReady = (g) => typeof g === 'object' && g !== null && typeof g.registerPlugin === 'function';","tryCatchPattern":null,"preventionTips":["Always pair every GSAP plugin import with a gsap.registerPlugin call in the app entry file","Keep GSAP core as the first script/import in load order","Add a dev-mode assertion that gsap is defined before instantiating tools"],"tags":["gsap","plugin-registration","initialization"],"backgroundTag":"missing-gsap-plugin-registration","analyzedSha":"13e2b790546426a1a2e0e9b409f3f8dc6d6611f2","analyzedAt":"2026-08-29T08:34:05.027Z","schemaVersion":2},"datasetVersion":"2026-08-29T12:17:43.993Z"}