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

src interpreted as JSON

Open letmejustfixthat opened this issue 2 years ago • 0 comments

Good day :-)

I'm managing an Angular component library at my company (similar to Angular Material). Recently we added a wrapper for the lottie player. Now the strange thing:

  • The component library is an Angular multiproject setup, one being the lib and the other being the lib-demo (think of it as material.angular.io, so a demo/showcase app with source code examples etc)
  • When using the lottie-player in the demo app, everything works as expected without any problems (not only locally but also in the prod build being deployed somewhere)
  • How ever, when integrating the lib into our products and trying to use it I only see that little yellow warning sign
  • Some debugging showed, that the lottie player seem to interpret the value of the src attribute as JSON (the lottie file is, how ever, downloaded by the client)
  • I'm using the exact same asset as in the demo, but tried different lottie files with the same result

Some screenshots:

Error (eaten by a try catch) image

Asset being loaded: image

Have you any idea what's going wrong? Or what I'm doing wrong?

Additionally I'd have a feature request regarding this (but I suppose that would rather be something for lottie-web?): It would be nice if the error event listener would transport the actual error. So listening to an error will get you no information but that there was an error, but not what the actual problem was, which makes debugging a bit more complicated.

letmejustfixthat avatar Feb 17 '23 13:02 letmejustfixthat