Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Json file not working #659

Closed
juanicarmesi opened this issue Oct 6, 2017 · 12 comments
Closed

Json file not working #659

juanicarmesi opened this issue Oct 6, 2017 · 12 comments

Comments

@juanicarmesi
Copy link

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!

@bodymovin
Copy link
Collaborator

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

@juanicarmesi
Copy link
Author

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?

@bodymovin
Copy link
Collaborator

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.

@juanicarmesi
Copy link
Author

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

@bodymovin
Copy link
Collaborator

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

@juanicarmesi
Copy link
Author

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

@juanicarmesi
Copy link
Author

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

@bodymovin
Copy link
Collaborator

Glad it worked :)

@RalfZhang
Copy link

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

@RalfZhang
Copy link

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

@janekkkk
Copy link

janekkkk commented Sep 6, 2019

Should be animationData: animationData.default

See: chenqingspring/vue-lottie#20

@mdbesoain
Copy link

Should be animationData: animationData.default

See: chenqingspring/vue-lottie#20

This should be marked as the solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants