# DracoCompression.Configuration not working in 5.0.0-alpha.37?

**URL:** <https://forum.babylonjs.com/t/dracocompression-configuration-not-working-in-5-0-0-alpha-37/22828>\
**Category:** Questions\
**Created:** [August 5, 2021, 7:36am UTC](https://forum.babylonjs.com/t/dracocompression-configuration-not-working-in-5-0-0-alpha-37/22828 "2021-08-05T07:36:38Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkM](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@MarkM](https://forum.babylonjs.com/u/MarkM)\
**Post date:** [August 5, 2021, 7:36am UTC](https://forum.babylonjs.com/t/dracocompression-configuration-not-working-in-5-0-0-alpha-37/22828/1 "2021-08-05T07:36:38Z")

</div>

Hi,

I have just switched from “latest” to “preview” in my project and Draco decompression has broken. I have a situation where I need to run disconnected from the web so I have a local copy of the draco scripts and set the configuration like this

```auto
        DracoCompression.Configuration = {
            decoder: {
              wasmUrl: process.env.PUBLIC_URL + '/assets/draco/draco_wasm_wrapper_gltf.js',
              wasmBinaryUrl: process.env.PUBLIC_URL + '/assets/draco/draco_decoder_gltf.wasm',
              fallbackUrl: process.env.PUBLIC_URL + '/assets/draco/draco_decoder_gltf.js',
            }
        }

```

where process.env.PUBLIC\_URL equates to the root on my dev server (it is a React app). This all worked until I updated to 5.0 (I also downloaded “fresh” versions of the draco scripts from preview). Now I get this message…

Failed to execute ‘importScripts’ on ‘WorkerGlobalScope’: The URL ‘/assets/draco/draco\_wasm\_wrapper\_gltf.js’ is invalid.

If I append that path to the browser address I do see the file. Has anything changed with the way DracoCompression.Configuration is handled? If I comment out my configuration block and use the default then it works, however this requires that I am connected to the web but for my solution I need it to work when not connected to the web.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [August 5, 2021, 8:58am UTC](https://forum.babylonjs.com/t/dracocompression-configuration-not-working-in-5-0-0-alpha-37/22828/2 "2021-08-05T08:58:56Z")

</div>

Adding @bghgary.

Are you sure that locally the .js and .wasm files do match (meaning, they are from the same version of the decoder)?

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [August 5, 2021, 4:31pm UTC](https://forum.babylonjs.com/t/dracocompression-configuration-not-working-in-5-0-0-alpha-37/22828/3 "2021-08-05T16:31:13Z")

</div>

I don’t think this has changed recently. Are you sure `process.env.PUBLIC_URL` is set correctly? From the error you are seeing, it looks like this variable might be an empty string.

---

<div class="post-metadata">

**Author:** ![MarkM](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@MarkM](https://forum.babylonjs.com/u/MarkM)\
**Post date:** [August 5, 2021, 11:28pm UTC](https://forum.babylonjs.com/t/dracocompression-configuration-not-working-in-5-0-0-alpha-37/22828/4 "2021-08-05T23:28:27Z")

</div>

Yes, I am using the correct version. I got them from here and made sure I cleared cache etc.  
fallbackUrl: “[https://preview.babylonjs.com/draco\_decoder\_gltf.js](https://preview.babylonjs.com/draco_decoder_gltf.js)”  
wasmBinaryUrl: “[https://preview.babylonjs.com/draco\_decoder\_gltf.wasm](https://preview.babylonjs.com/draco_decoder_gltf.wasm)”  
wasmUrl: “[https://preview.babylonjs.com/draco\_wasm\_wrapper\_gltf.js](https://preview.babylonjs.com/draco_wasm_wrapper_gltf.js)”

It seems that DracoCompression.Configuration cannot use relative paths. The process.env.PUBLIC\_URL does return a blank when in my dev environment which used to work. If I change that to window.location.href then it works so it seems to need a fully qualified path. Maybe it was just luck that it worked in 4.20.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [August 5, 2021, 11:53pm UTC](https://forum.babylonjs.com/t/dracocompression-configuration-not-working-in-5-0-0-alpha-37/22828/5 "2021-08-05T23:53:55Z")

</div>

Looks like you are right. This is a regression from this PR: [meshopt fixes and misc cleanup · BabylonJS/Babylon.js@95db4c8 (github.com)](https://github.com/BabylonJS/Babylon.js/commit/95db4c8a0dca359664d3647e1f7d4476b9ec7f6d#diff-0e7f8d4ea2370427c7f494b929eb3f94b2fd7f4e345987179830407074cb7e81)

Do you mind filing a bug for this?

---

<div class="post-metadata">

**Author:** ![MarkM](https://avatars.discourse-cdn.com/v4/letter/m/9de053/32.png) [@MarkM](https://forum.babylonjs.com/u/MarkM)\
**Post date:** [August 5, 2021, 11:58pm UTC](https://forum.babylonjs.com/t/dracocompression-configuration-not-working-in-5-0-0-alpha-37/22828/6 "2021-08-05T23:58:58Z")

</div>

Yep, will do. Thanks.

---

<div class="post-metadata">

**Author:** ![bghgary](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/bghgary/32/48532_2.png) [@bghgary](https://forum.babylonjs.com/u/bghgary)\
**Post date:** [August 9, 2021, 8:18pm UTC](https://forum.babylonjs.com/t/dracocompression-configuration-not-working-in-5-0-0-alpha-37/22828/7 "2021-08-09T20:18:24Z")

</div>

This has been addressed in this PR: [Factor out meshopt into its own class by bghgary · Pull Request #10830 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/10830).
