Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError: Cannot read property 'x' of undefined #64

Open
skyprod opened this issue Apr 26, 2016 · 1 comment
Open

Uncaught TypeError: Cannot read property 'x' of undefined #64

skyprod opened this issue Apr 26, 2016 · 1 comment

Comments

@skyprod
Copy link

skyprod commented Apr 26, 2016

Got this error on a particular path, apparently no different from fully functional paths in the same project. It broke the script and hindered the animation from running. The error pointed to line 540.

Solved it by adding if (typeof position !== 'undefined') on line 539, making it:

if (typeof position !== "undefined") {
    path.position = {
        x: data.offset.left + position.x,
        y: data.offset.top + position.y
    };
}

The shape now animates perfectly, not missing any paths.

@skyprod
Copy link
Author

skyprod commented Apr 27, 2016

I found there was a empty path point in my svg file (so the script couldn't find a starting and end point to do calculations with). Removed it and it worked again. So my fix is basically useless. But I'll leave this here in case others get the same error, and wont have to go through the same process as me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant