Setting the value 0 to the DefaultNumWorkers from DracoCompression throw an Engine error since 6.21.1 version

I’m using the line : “BABYLON.DracoCompression.DefaultNumWorkers = 0;”. To force the Engine to use the default js script and not the wasm one because of an incompatibility with JS Obfuscator. But since the 6.21.1 version, the line throw this error : “Engine must be provided in the buffer constructor in order to create”.

Everything worked fine before the last version.

ping @bghgary

Thanks for the report! I will investigate.

@Kidsarow Can you send a PG? I don’t repro.

I cannot reproduce it in the PG. I’m using Babylon.js in Electron with Webpack to bundle the whole. Maybe it come from it. I still not figured out why but It seems that the worker cannot access the engine.

Can you put up an example repo?

@bghgary @Kidsarow Greetings, I am also having this exact error but only on the Native side not on the BabylonJS side.

its coming from here:

As stated above, was working fine before prior to the upgrade to latest (6.21.1). Was there an update to the draco decoder or something? Obviously the worker does not see the Engine. I’ll see what I can do for a repro in the Native Example app.

Yes, I made some changes. I added this error. I need a repro. :slight_smile:

got it lol. Working on a repro as we speak :slight_smile:

1 Like

here is a draco compressed .glb we’re trying to load. This loads fine in the PG with no errors.

so using the NativeExample app, modify this line below.

with this

   std::array<Asset, 4> assets = {
        Asset{"BoomBox", ""},
        Asset{"DRCHat", ""}

the DRCHat asset fails with an error:

Unhandled exception at line 62, column 5 in app:///Scripts/index.js
0x800a139e - JavaScript runtime error: Unable to load from Unable to get absolute URL. Override BABYLON.Tools.GetAbsoluteUrl to a custom implementation for the current context.

also in index.js you can add this to make sure the draco decoder is set up correctly…

    // draco decoder settings
    var decoder = {
        wasmUrl: "",
        wasmBinaryUrl: "",
        fallbackUrl: "",
    BABYLON.DracoCompression.Configuration = { decoder };

i realize this error is different than the one im getting in our app… but perhaps its is a step forward or related? :confused: I’ll keep digging.

BabylonNativeExamples has not been updated with my latest changes, so maybe that’s why. I’ll try it.

@bghgary sorry I did update the example app to use BabylonJS 6.21.1 and latest native (latest commit in native

commit 4b8b9e69d0bf59bb1912a638f761013eb9045646 (HEAD -> master, origin/master, origin/HEAD)
Author: Gary Hsu <>
Date:   Wed Sep 13 13:13:23 2023 -0700


I don’t think Draco works in native. There are some issues with loading scripts that make it not work. This hasn’t changed recently. Did Draco work for you before and now it’s not working?

@bghgary we got draco working. But im having a hard time replicating this exact issue on the Example App. Plan B will be to figure out how to get you our actual app so you can debug through it.

This PR has the fix. Sorry for the troubles!

Better fix for recent Draco changes by bghgary · Pull Request #14351 · BabylonJS/Babylon.js (

1 Like