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.

playSegments: Cannot read property '0' of undefined

See original GitHub issue

Version: “react-lottie”: “^1.2.3”,

Calling playSegments seems to always yield the below error.

Tried all of these options and got the same error: table.playSegments({0:[0, 40]}, true); table.playSegments([0, 40], true); table.playSegments([[0, 40]], true);

Error:

lottie.js:9250 Uncaught TypeError: Cannot read property '0' of undefined
    at AnimationItem.playSegments (lottie.js:9250)
    at Lottie.playSegments (index.js:151)

Options:

const tableOptions = {
  loop: true,
  autoplay: true,
  path: 'assets/table.json',
  subframeEnabled: false,
  rendererSettings: {
    preserveAspectRatio: 'xMidYMid slice'
  }
};

React placement:

<Lottie
  options={tableOptions}
  ref={this.tableEl}
/>

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7

github_iconTop GitHub Comments

2reactions
jadboxcommented, Oct 25, 2018

Going to close this for now, but I rather recommend if there was an official React wrapper for Lottie. :]

0reactions
bodymovincommented, Oct 24, 2018

yes, it’s related to react-lottie indeed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

React Native Lottie: Cannot read property 'play' of undefined
I'm using the Lottie imperative API to display a looping animation. The imperative API works fine on all of my components except one...
Read more >
Lottie (Web) - Airbnb Engineering & Data Science
Lottie for Web. Lottie is a mobile library for Web, and iOS that parses Adobe After Effects animations exported as json with Bodymovin...
Read more >
Animating with Lottie | CSS-Tricks
Her are the properties we have to work with: container : the DOM element that the animation is loaded into; path : the...
Read more >
Lottie Player - Interactivity Guide - LottieFiles
The name of the player ie: 'firstLottie' in this example is the ID set to the ... for the height of the lottie...
Read more >
equality crystal Woods cannot set property 0 of undefined sick ...
Home. equality crystal Woods cannot set property 0 of undefined sick out of service Ten years. Uncaught TypeError: Cannot read property 'siteAbsoluteUrl' of ......
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