react-lottie icon indicating copy to clipboard operation
react-lottie copied to clipboard

Cannot read property 'length' of undefined at SVGRenderer.configAnimation

Open Mujaddadi opened this issue 6 years ago • 4 comments

I know many people got the same error but I have a weird situation. I got this error when I migrated to webpack 4 from webpack 2. It was working fine in webpack 2. I am using exact same version number and animation file just the web pack version is different.

I read in other similar [issues] (https://github.com/airbnb/lottie-web/issues/1120) and some suggested it's because of uglification but when I looked at the source, I found this in (bodymovin.js:5720) this.elements = Array.apply(null,{length:animData.layers.length})

it doesn't seems to be uglified. I think the problem is in the lottie-web not in this wrapper. Any idea?

Mujaddadi avatar Oct 26 '18 11:10 Mujaddadi

#24 also didn't help. I am not using react-script.

Mujaddadi avatar Oct 26 '18 11:10 Mujaddadi

Hey there's some new updates on that issue, we found it helpful https://github.com/chenqingspring/react-lottie/issues/24

mokutsu avatar Nov 21 '18 15:11 mokutsu

I'm seeing this error in CRA2

acomito avatar Dec 15 '18 21:12 acomito

As @eliasrodeloso suggested in #24, I fixed this by changing:

import * as animationData from '../../assets/animations/myAnimation.json';

To:

import animationData from '../../assets/animations/myAnimation.json';

AllanPooley avatar Jul 12 '19 06:07 AllanPooley