Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
Eunomiac

Missing Plugin Error with gsap.set(... {clearProps: "transform"})

Recommended Posts

The following effect ...

gsap.registerEffect({
  name: "brighten",
  effect: (targets, config) => gsap.to(targets, {
    color: C.html.colors.fgBright,
    scale: 1.25,
    duration: config.duration,
    onReverseComplete() { gsap.set(this.targets, {clearProps: "transform"}) }
  }),
  defaults: {duration: 0.25},
  extendTimeline: true
}

... results in the following console error when run:

gsap-core.js:84 Invalid property clearProps set to transform Missing plugin? gsap.registerPlugin()
  _missingPlugin	   @ gsap-core.js:84
  _addPropTween		   @ gsap-core.js:2644
  _initTween		   @ gsap-core.js:2819
  _attemptInitTween	   @ gsap-core.js:433
  _renderZeroDurationTween @ gsap-core.js:469
  render		   @ gsap-core.js:3030
  Tween			   @ gsap-core.js:3004
  set			   @ gsap-core.js:3277

I've copied the gsap.set() syntax directly from the CSSPlugin docs which, as far as I understand, is integrated into gsap core and doesn't need to be registered (though I registered it anyways, to no avail).  Any insights as to why I'm getting this error and what I can do about it is, as always, very much appreciated!

 

(I didn't think a codepen demo was necessary for such a specific question, but please let me know if I should provide one!)

Link to comment
Share on other sites

Hello there! 

A codepen is always helpful.

I think the likely issue here is thatthis.targets doesn't have the property you're trying to target or clear. 

If you console.log(this.targets)out in that callback what do you get?

  • Like 2
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×