aspnetcore
aspnetcore copied to clipboard
Using Lottie in Blazor
Is there an existing issue for this?
- [X] I have searched the existing issues
Describe the bug
I am trying to use Lottie in Blazor and it should be straightforward but I guess I am doing something wrong.
I followed this: https://lottiefiles.com/blog/working-with-lottie/how-to-add-lottie-animation-in-web-page-html/
Using in _Layout throws error because of "@" character -> I put one more to escape it -> but result is empty lottie player with yellow warning triangle instead of animation.
I thought its maybe because of double @ character so I just copied whole script locally to scripts.js and import it in _Layout but the same result -> empty lottie player with yellow warning triangle instead of animation.
Is there any known workaround or guide what should I do?
Expected Behavior
To display lottie animation.
Steps To Reproduce
Create blazor project and folow https://lottiefiles.com/blog/working-with-lottie/how-to-add-lottie-animation-in-web-page-html/
Exceptions (if any)
No response
.NET Version
7.0.100-rc.1.22431.12
Anything else?
No response
Hey @Laftek, thanks for reaching out. Are you seeing any errors in the developer tools console?
Hi @Laftek. We have added the "Needs: Author Feedback" label to this issue, which indicates that we have an open question for you before we can take further action. This issue will be closed automatically in 7 days if we do not hear back from you by then - please feel free to re-open it if you come back to this issue after that time.
Hi! It worked for me with the double @. Probably is a problem with your animation's JSON.



You are right, I messed up 2 characters in the link. Now its working! Thank you! Also its working with WASM/MAUI (dont forget to call script OnAfterRenderAsync)