bodymovin / lottie-api

A library to edit lottie-web animations dynamically
MIT License
180 stars 38 forks source link

Animation not following instruction in local svelte build #32

Open Rassibassi opened 2 years ago

Rassibassi commented 2 years ago

Hej,

I am trying to integrate lottie-web and lottie-api in a Svelte application. I took the following codepen example: https://codepen.io/driezis/pen/zYOQLrw

and made a svelte version from it: https://codesandbox.io/s/followingfacesvelte-3grho

It works nicely in the codesandbox, but when I download the zip with all the files from the codesandbox and try to have it build locally, the face is not following the mouse.

It may has something to do with this issue: https://github.com/airbnb/lottie-web/issues/2599

I am out of my depth by now, any suggestions on how to solve this?

Best, Rasmus

bodymovin commented 2 years ago

hi, can you share a link with the build breaking so I can take a look?

Rassibassi commented 2 years ago

Not sure, what you mean, but if you follow this link: https://codesandbox.io/s/followingfacesvelte-3grho

Then just above where you can see the files (the file explorer), next where it says "Files", there is an arrow down button, which let's you download a zip file.

unzip, and run yarn install and yarn dev, and then visit the localhost served page, and the face does not follow the mouse :(

bodymovin commented 2 years ago

Yes, it's the same problem. Rollup doesn't correctly build the library and breaks. I'm working on a fix but it will take some time to have it working. Perhaps in a couple of weeks. As a workaround, I'd suggest to load the library separately instead of being part of the build

Rassibassi commented 2 years ago

Cool, thanks for your answer. I made the app work locally by using svelte with webpack instead of rollup.

For anyone bumping into this issue, my workaround: I started developing the svelte/webpack version from this repository, https://github.com/sveltejs/template-webpack and bumped all the dependencies to latest via yarn upgrade --latest, then built my svelte app from there.