Draco_wasm_wrapper_gltf.js:38 failed to asynchronously prepare wasm: LinkError: WebAssembly.instantiate(): Import #4 module="a" function="e" error: function import requires a callable

Hello.
When loading a glb model with draco compression in babylon, sometimes the following error appears.
We can’t make such an error during the service, so we’d appreciate it if you could tell us how to solve it.

failed to asynchronously prepare wasm: LinkError: WebAssembly.instantiate(): Import #4 module=“a” function=“e” error: function import requires a callable
(anonymous) @ draco_wasm_wrapper_gltf.js:38

Aborted(LinkError: WebAssembly.instantiate(): Import #4 module=“a” function=“e” error: function import requires a callable)
y @ draco_wasm_wrapper_gltf.js:24

Uncaught (in promise) RuntimeError: Aborted(LinkError: WebAssembly.instantiate(): Import #4 module=“a” function=“e” error: function import requires a callable). Build with -sASSERTIONS for more info.
at y (draco_wasm_wrapper_gltf.js:24:34)
at draco_wasm_wrapper_gltf.js:38:176

Looks like a compatibility issue.
Are you switching multiple projects with different Babylon version? Maybe there is an incompatible draco_wasm_wrapper_gltf.js in cahce.
Try to clear browser cache and hard reload?

The same thing happened when I brought the glb to the sandbox of Babylon. It didn’t work even with the disable cache mode, but now it’s working again. Did Babylon update the module related to draco today?

The draco distribution was recently updated in Improve Draco decoder processing code by bghgary · Pull Request #14311 · BabylonJS/Babylon.js (github.com)

1 Like

cc @bghgary fyi

Interesting, apparently some CDN shenanigans. My guess is not all of the files updated at the same time and some were old. @RaananW Is this possible?

i can’t think of a case this could happen, unless the request was made right before pruning was triggered.
This could have been a general issue with caching and the Azure CDN that was resolved without us intervening.

2 Likes