question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

path.el.getPointAtLength is not a function[Learn More] anime.js:490:16

See original GitHub issue

This happens in Safari and Firefox but not in Chrome.

    function getPathProgress(path, progress) {
      function point(offset = 0) {
        const l = progress + offset >= 1 ? progress + offset : 0;
        return path.el.getPointAtLength(l); // here
      }
      const p = point();
      const p0 = point(-1);
      const p1 = point(+1);
      switch (path.property) {
        case 'x': return p.x;
        case 'y': return p.y;
        case 'angle': return Math.atan2(p1.y - p0.y, p1.x - p0.x) * 180 / Math.PI;
      }
    }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Imprasnacommented, Jun 12, 2021
Uncaught TypeError: n.el.getPointAtLength is not a function
    at r (anime.min.js:491)
    at V (anime.min.js:494)
    at I (anime.min.js:765)
    at Object.M.reset (anime.min.js:801)
    at en (anime.min.js:818)
    at index.html:34

Can someone help me fix this error, this pops when I run the anime.js file.

0reactions
Radiocabeacommented, Sep 2, 2021
Uncaught TypeError: n.el.getPointAtLength is not a function
    at r (anime.min.js:491)
    at V (anime.min.js:494)
    at I (anime.min.js:765)
    at Object.M.reset (anime.min.js:801)
    at en (anime.min.js:818)
    at index.html:34

Can someone help me fix this error, this pops when I run the anime.js file.

Hello! Make sure that on the path definition your adding path to the end of the sentence! I’ve found this video which is very helpful. don’t forget to add the path at the end! in my case this was the issue, I was only doing anime.path(“SVG”) instead of anime.path(“SVG path”)

https://youtu.be/mAKYW_1f-dw

Read more comments on GitHub >

github_iconTop Results From Across the Web

SVGGeometryElement.getPointAtLength() - Web APIs | MDN
The SVGGeometryElement.getPointAtLength() method returns the point at a given distance along the path.
Read more >
getPointAtLength with SVG not working correctly
As you loop through flattening the path, call the mypath.getPathSegAtLength() function. It returns the index of the pathseg entry at that length ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found