Skip to content

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

@skyprod

Description

@skyprod

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions