Progressive Loading With LODs example playground doesn't work on Firefox

From this doc page Progressively Load .glTF Files | Babylon.js Documentation
we have this playground example https://playground.babylonjs.com/#ARN6TJ#5

  • Chrome v88: no issue :heavy_check_mark:
  • Firefox v86: Uncaught (in promise) RangeError: offset is outside the bounds of the DataView issue, and no 3D visible
  • Edge v88: hmm, even https://playground.babylonjs.com/ throw an error :sweat_smile: Uncaught DOMException: Failed to read the 'localStorage' property from 'Window': Access is denied for this document. (so not relative to this particular example)

Note that with this simple code in local webserver, Firefox load the model:

<body>
    <canvas id='canvas'></canvas>
    <script type="text/javascript">
        var canvas = document.getElementById("canvas");
        var engine = new BABYLON.Engine(canvas, true);
        var scene = new BABYLON.Scene(engine);
        scene.createDefaultCameraOrLight(true, true, true);

        BABYLON.SceneLoader.OnPluginActivatedObservable.addOnce(function (loader) {
            if (loader.name === "gltf") {
                loader.useRangeRequests = true;
            }
        });

        BABYLON.SceneLoader.AppendAsync(
            "https://cdn.cp.adobe.io/content/2/content/93f19c5b-5587-4f4f-95bd-99295214aade/version/0",
            undefined,
            scene,
            undefined,
            ".glb"
        );

        engine.runRenderLoop(function () {
            scene.render();
        });

        window.addEventListener("resize", function () {
            engine.resize();
        });
    </script>
</body>

But I tried to reproduce this code into the playground, and get the same console error in Firefox! Babylon.js Playground

Adding @bghgary

@Vinc3r I havenโ€™t gotten a chance to look at this yet. Is this an urgent issue for you?

Take your time :wink:

1 Like

This seems like a Firefox bug. I did a miminal repro in jsfiddle.net and the arraybuffer returned is zero bytes.

https://jsfiddle.net/hLqcxvu6/2/

I filed a bug on Firefox. Letโ€™s see what happens.

1696684 - XMLHttpRequest with partial content returns zero bytes response (mozilla.org)

2 Likes