-
Notifications
You must be signed in to change notification settings - Fork 14
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
DotLottie React - Runtime Error: Memory access out of bounds #376
Comments
@mabernethy which version of DotLottieReact you're using ? |
@theashraf experiencing the same issue on 0.9.3 version. interestingly, when you set a style to less than 150px the file loads. |
noticed that the 0.10.0 version was released today, but the issue is still there. |
@nasringh @aldibatyr can you share with me your .lottie or .json asset ? |
@mabernethy I'm not able to replicate the same issue on the latest version of dotlottie-react, maybe it was a different asset ? You can try testing it again on the dotLottie Viewer -> https://lottiefiles.github.io/dotlottie-web/ |
@theashraf the files that are exported with lottie plugin from figma create that error. Lotties exported from AE are okay. |
Just tested the files that are hosted in lottiefiles and they work remotely or when downloaded and stored locally. |
@nasringh @mabernethy could you also check various files exported via figma vs Adobe After Effects? |
@aldibatyr if you can share with me one or few problematic assets, that would help me investigate the root cause |
Sure! @theashraf attaching the file |
@aldibatyr I'm not encountering the |
@theashraf the issue was indeed |
let me try creating a reproducible demo. I'll come back 👍 |
Thanks @aldibatyr i was able to reproduce it here, let me come back with a solution |
@theashraf great! Thanks a lot! |
@theashraf sorry for delay of response. I can share my .lottie file with you too |
@nasringh I can't download the attached asset
|
lottie.zip |
@nasringh I’m unable to replicate the issue on this CodePen using the attached asset Could you please let me know the canvas width and height properties when this issue occurs ? |
Thanks, @nasringh! I’m still unable to reproduce the issue. It would be great if you could fork my CodePen and update it to demonstrate the situation where the "Memory access out of bounds" error occurs. Regarding the requestAnimationFrame taking too long, I believe it’s because we’re using the non-production version of React over a CDN for demo purposes. but, let me know if you’re encountering the same issue in your application. |
@theashraf Could you please use |
@nasringh looks fine using the .lottie file as well, maybe you can provide me a codesandbox or a repo link with the reproducible example ? in case you can't reproduce on codepen |
@theashraf I tried to implement it in codesandbox but it doesn't work :( https://codesandbox.io/p/sandbox/delicate-snow-t44q57 |
@nasringh The To resolve this issue, move the asset (Hub_Invite.json) to the public folder of your project. This will allow it to be accessed via a relative URL. updated example: https://codesandbox.io/p/sandbox/peaceful-leaf-rql4f7 |
@theashraf I used your advice and it worked but as you said I could not see the error in the test case but exactly this time I saw the error in my own codes and this is almost close to my own code in the project https://codesandbox.io/p/sandbox/delicate-snow-t44q57?file=%2Fsrc%2FApp.js%3A2%2C31 |
@nasringh could you please provide me the campaign.lottie animation you've tested here ?
|
@theashraf It's exactly the lottie file that I sent to you only their name are different |
@nasringh can you confirm that you're using @lottiefiles/[email protected] in your project ? |
@theashraf Yes exactly |
@theashraf I tried a lot of things to find the issue in my codes for example I changed the place of |
Sorry for the delayed response, I've been traveling. I've been playing with my setup today in an effort to provide more details. Unfortunately, the only thing I think I found was that it's really inconsistent when the Runtime error appears (Memory error). I had written up a nice explanation about how the failures are random. I added 2 Lottie animations to a single panel. Both were generated using the Lottie-to-DotLottie converter based off JSON files created in After Effects. In my initial testing, only one of the animations would animate and the other one would throw the memory error we've all been seeing. The one that threw the error wasn't consistent, it was random. I wrote that up and then tried testing it with different properties for the height and width of the wrapper panel I've added around the So, I don't have much to add to the discussion other than "it's random and seemingly unexplainable". Tested on: And just as I was about to press "Comment", one of the animations failed when I changed my package.json to "^0.11.0". My gut feeling is that it's related to the height and width properties, as @nasringh pointed out. When I started adjusting the height/width of my wrapper DIV, that's when it started working correctly. It seems to consistently work when I provide a specific pixel value to both the height and width, e.g. |
This isn't the Height and Width. Being there prob stops some infinite loop or something but it's prob something to do with state being set over and over leading to OOM in the worker running it. That's my assumption. Haven't looked in the code base yet! |
@theashraf Hi again, |
@mabernethy @nasringh @EfstathiadisD I’ve made a new release with a fix for this issue in @lottiefiles/[email protected]. It turns out the problem originated in the dotLottie-rs renderer -> thorvg, and it has been reported here. The issue was resolved in thorvg v0.15.6. @EfstathiadisD it’s challenging to pinpoint the exact cause of an error coming from the .wasm binary since we strip all the symbols from it to reduce the binary size. but i’m planning to include two versions of the .wasm binary in our codebase: one with all the debug symbols and another for release. We could allow users to load the debug .wasm file by setting a debug flag or something similar in the DotLottie instance or React component. This would help us quickly identify issues when they arise. Thank you all for reporting these issues and sharing your insights, really help improve the project! Let me know if the issue still persists |
Overview
I have a Lottie file in JSON that my team has been using with an older Lottie player (LottieLight). We're looking to upgrade to better Lottie player with smaller animation files. As part of that work, I've integrated the DotLottieReact component into our codebase. In my initial tests, I converted one of our existing JSON files into a .lottie file using the website https://lottiefiles.com/tools/lottie-to-dotlottie .
In my first initial hacked together proof of concept, I got the animation working as I would expect. No errors or anything. I then built out a more robust proof of concept, and converted another JSON file into a .lottie file (Attached here as a Zip file). However, when I try to display this lottie file in the browser, I continually get
"Uncaught Runtime Error: memory access out of bounds" errors."
Browser: Latest version of Chrome
OS: MacOS Sonoma 14.7
Machine: M3 Macbook Pro
RAM: 32 Gb
dotlottie-memory-issue.lottie.zip
...
Consuming repo
Labels
Type: Bug
Type: Bug
label to this issue.The text was updated successfully, but these errors were encountered: