Lottie-web: Json file not working

Created on 7 Oct 2017  Â·  12Comments  Â·  Source: airbnb/lottie-web

Hi, I exported from AE the json file and its not working, I tried with other json files uploaded as example and they work perfectly in my web.

You can see the file here: http://viim.co/js/hero.json

My AE file: https://www.dropbox.com/s/uxulyyf2acxhemc/hero%20image.aep?dl=0

Thank you for your help!

Most helpful comment

Should be animationData: animationData.default

See: https://github.com/chenqingspring/vue-lottie/issues/20

All 12 comments

Hi, I've tried it and it seems to be working fine.
What is it that you see failing?

Thanks for your reply, I created a CodePen https://codepen.io/jvelezr/pen/OxQOoB you can see there that when I enter my file in "path" it doesn´t work, but when I use other .json as example (https://labs.nearpod.com/bodymovin/demo/2016/data.json) it does.

What am I doing wrong?

you're getting a browser security error:
Mixed Content: The page at 'https://codepen.io/jvelezr/pen/OxQOoB' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://viim.co/js/hero.json'. This request has been blocked; the content must be served over HTTPS.

But the same thing happens when I load everything in localhost. I checked the console and get this:

bodymovin.js:5 Error: attribute width: Expected length, "undefined".
SVGRenderer.configAnimation @ bodymovin.js:5
bodymovin.js:5 Error: attribute height: Expected length, "undefined".
SVGRenderer.configAnimation @ bodymovin.js:5
bodymovin.js:5 Error: attribute viewBox: Expected number, "0 0 undefined undefi…".
SVGRenderer.configAnimation @ bodymovin.js:5

Can you try reproducing that error on codepen so I can check it?

Hi I get a different error when changed the url to https "No 'Access-Control-Allow-Origin' header is present on the requested resource." I updated the codepen.

I can share the folder with the index file, maybe is easier? https://www.dropbox.com/sh/albcxty6ku21jad/AACdVxuutSoowxWL9Omggymga?dl=0

Hi! I'm so sorry, I had a stupid mistake :) a couple letters misspeled. Thanks for your help and support 🥇

Glad it worked :)

@jvelezr Hey, I got the same error like you.
Error: <svg> attribute width: Expected length, "undefined".
Do you remember what happened?
Thank you.

Sorry for bothering. I have found the reason. I replaced path to animationData.
XD

Should be animationData: animationData.default

See: https://github.com/chenqingspring/vue-lottie/issues/20

Should be animationData: animationData.default

See: chenqingspring/vue-lottie#20

This should be marked as the solution.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jumostudio picture jumostudio  Â·  3Comments

Sandok-voc picture Sandok-voc  Â·  4Comments

zhengs picture zhengs  Â·  3Comments

ochanje210 picture ochanje210  Â·  3Comments

processprocess picture processprocess  Â·  3Comments