Jump to content
Search Community

RangeError: Invalid array length , MotionPath{ path_vars }

Jim Tim test
Moderator Tag

Recommended Posts

I'm migrating from gsap version 2 - version 3,

 

whenever i try to play timeline method i get this RangeError: invalid array length,

i suspects this error occurs  because of motionPath vars attributes in gsap.to(),

i pass array of co-ordinates to path key, when i pass type:'cubic' it works fine but i dont want the type to be 'cubic',
i'm looping through some keyFrames so someTIme the co-ordinates can be same,
eg:- 

[
    [
        {x: 28.4991, y: 0},
        {x: 28.4991, y: 0}
    ],
    [
        {x: 28.4991, y: 0},
        {x: 28.4991, y: 0}
    ],
    [
        {x: 28.4991, y: 0},
        {x: 28.4991, y: 0}
    ],
    [
        {x: 28.4991, y: 0},
        {x: 1074.759725, y: 0}
    ]
]

err1.png

 

Link to comment
Share on other sites

  • Jim Tim changed the title to RangeError: Invalid array length , MotionPath{ path_vars }

Sorry  team it's hard for me to create a demo in codePen,
but in local i get the error since those error  will only throw in development  environment ,
 

            let pathValArr = MotionPathPlugin.arrayToRawPath([{x:155.33,y:225.01},{x:155.33,y:225.01},{x:155.33,y:225.01}]);
            let pathValStr = MotionPathPlugin.rawPathToString(pathValArr)

 

but this is what the scenario is,  try passing three similar coordinates  to MotionPathPlugin.arrayToRawPath() method ,
 you will get that error.err1.thumb.png.41a6bf73ee7b4ccf3176b35355b4f2f7.png

Link to comment
Share on other sites

// That's a very odd scenario , yeah you're right but for my project for many paths it has been plotted like this. in previous  version ,i haven’t got any issues and kindly fix this issues by next release.
Thank you for the quick  response 

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.
×
×
  • Create New...