Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
404Assassin

TypeError with Draggable .create Angular 8 and GSAP 3

Recommended Posts

Hi,

 

Hoping someone may have some insight into why I'm getting this type error. GSAP v3 itself is working great with Angular 8 and I'm enjoy many of the new features however I ran into a type error with Draggable on the create method:

 

ERROR TypeError: _toArray is not a function
    at Function.create (Draggable.js:2612)

 

Has anyone else run into this and know of a possible solution?  I've tried all the different imports and the top declaration of Draggable but all of those work arounds were for GSAP v2 and don't appear to work here. 

 

 

 

 

Link to comment
Share on other sites

Without seeing a reduced test case, my best guess is that you just forgot to register Draggable. 

gsap.registerPlugin(Draggable);

(Obviously do that before you actually use Draggable)

 

Does that help?

  • Like 2
  • Thanks 2
Link to comment
Share on other sites

Thanks Jack!

 

Sorry about that, I totally missed the register plugin feature, I guess when all else fails read the documentation....

 

Thanks again for an awesome platform!

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...
10 hours ago, alxbot said:

I have the same error in react

"_toArray is not a function"

Hey alxbot. You must do what this thread says to do - register Draggable. 

gsap.registerPlugin(Draggable);

However, you're not even loading GSAP in that demo. Import that as well and it works:

import { gsap } from "gsap";

 

  • Like 1
Link to comment
Share on other sites

On 1/27/2020 at 9:21 AM, ZachSaucier said:

Hey alxbot. You must do what this thread says to do - register Draggable. 


gsap.registerPlugin(Draggable);

However, you're not even loading GSAP in that demo. Import that as well and it works:


import { gsap } from "gsap";

 



Yes It works, im so noob . Thank you so much

  • Like 1
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.

×