LottieFiles / dotlottie-web

Official LottieFiles player for rendering Lottie and dotLottie animations in the web. Supports React, Vue, Svelte, SolidJS and Web Components.
https://developers.lottiefiles.com/docs/dotlottie-player/
MIT License
191 stars 11 forks source link

Failed to load some animations #361

Closed bczhc closed 1 month ago

bczhc commented 1 month ago

Overview

dotlottie-web fails to load some animations for unknown reason.

Reproduction

Take this HTML page:

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Demo</title>
</head>
<body>
<canvas style="width: 300px; height: 300px" id="canvas"></canvas>

<script type="module">
    import {DotLottie} from "https://esm.sh/@lottiefiles/dotlottie-web";

    let canvas = document.querySelector('#canvas');
    new DotLottie({
        autoplay: true,
        loop: true,
        renderConfig: {
            devicePixelRatio: 1,
        },
        src: 'https://raw.githubusercontent.com/bczhc/bczhc.github.io/75ee4f6945699cd450b3815dd8839278b5129b6e/lottie/res/qlottie/1/24/24.json',
        canvas,
    })
</script>
</body>
</html>

In Firefox, the console shows:

Failed to load animation data from URL: https://raw.githubusercontent.com/bczhc/bczhc.github.io/75ee4f6945699cd450b3815dd8839278b5129b6e/lottie/res/qlottie/1/24/24.json. RuntimeError: index out of bounds

and Chrome shows

Failed to load animation data from URL: https://raw.githubusercontent.com/bczhc/bczhc.github.io/75ee4f6945699cd450b3815dd8839278b5129b6e/lottie/res/qlottie/1/24/24.json. RuntimeError: memory access out of bounds

However, if either changing the src field to https://raw.githubusercontent.com/bczhc/bczhc.github.io/75ee4f6945699cd450b3815dd8839278b5129b6e/lottie/res/qlottie/1/22/22.json or removing renderConfig, animation will be loaded.

Some won't be loaded at all. For example: https://raw.githubusercontent.com/bczhc/bczhc.github.io/75ee4f6945699cd450b3815dd8839278b5129b6e/lottie/res/qlottie/1/23/23.json, while https://app.lottiefiles.com/preview handles it well.

Labels

theashraf commented 1 month ago

@bczhc
This animation works fine on the dotLottie-web viewer:

The other animations are not working; it seems to be a renderer issue. We’ll update you once we figure out the root cause:

Thanks!

theashraf commented 1 month ago

@bczhc fixed in dotlottie-web v0.35.0