# Webgpu init issues

**URL:** <https://forum.babylonjs.com/t/webgpu-init-issues/23237>\
**Category:** Questions\
**Tags:** webgpu\
**Created:** [August 20, 2021, 2:32pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237 "2021-08-20T14:32:28Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [August 20, 2021, 2:32pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/1 "2021-08-20T14:32:28Z")

</div>

I’m testing WebGPU with Babylon on Electron and running into these issues:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/5/6/56aba7bd07c74913a8013fed7a64fc6c12ba1b4a.png)

after some browsing the warnings could be due to mime type not being registered in webpackdevserver, but I’m not sure what the file server could have to do with rendering wasm…

Another thing: when I try to test it in regular Chrome (stable or beta) with the `chrome://flags/#enable-unsafe-webgpu` enabled Babylon still says ‘WebGPU is not supported by your browser’. Am I missing something?

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 20, 2021, 3:30pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/2 "2021-08-20T15:30:46Z")

</div>

This is not a webgpu issue but an issue within your build where BABYLON namespace was not found (eg it is not referenced from your code somehow)

---

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [August 20, 2021, 4:05pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/3 "2021-08-20T16:05:03Z")

</div>

I thought the error might be solved if the warnings were solved.

this is the only diff between it working and not working

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/e/1/e1bb727cee042217883fd7c3175b03c2ae9d14ab.png)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 20, 2021, 4:17pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/4 "2021-08-20T16:17:52Z")

</div>

well this is super weird because the system error is about a missing ref to BABYLON

---

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [August 20, 2021, 4:19pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/5 "2021-08-20T16:19:07Z")

</div>

I just resolved my second question: I should have used Chrome Canary and not Chrome Beta.  
Now at least I got the playground working in Chrome and it gives the same warnings, so those are not the problem.

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/6/b68d83c700e2dcf6da651ffc134072bd87cb17cd.png)

---

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [August 20, 2021, 4:21pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/6 "2021-08-20T16:21:18Z")

</div>

this is where the error is (while calling engine.initAsync())  
(I’m using the latest alpha, and nowhere do I reference BABYLON. directly)

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/4/a/4ab00fbb5198673c0e1c79773068ec7833998eec.png)

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 20, 2021, 5:44pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/7 "2021-08-20T17:44:04Z")

</div>

let me add @syntheticmagus

---

<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 20, 2021, 7:32pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/8 "2021-08-20T19:32:33Z")

</div>

Are you using ES6? We need BABYLON to exist in the global namespace because of some initialization code for the TintWASM module. So, in ES6, you have to do something like:

```javascript
import * as BABYLON from "@babylon/core";
(window as any).BABYLON = BABYLON;

```

We will need to get rid of that, but for the time being it’s required.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [August 20, 2021, 10:02pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/9 "2021-08-20T22:02:08Z")

</div>

we need to make sure we track the need to get rid of it to not forget 😉

---

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [August 21, 2021, 12:08pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/10 "2021-08-21T12:08:29Z")

</div>

> [@Evgeni\_Popov](#):
>
> ```auto
> import * as BABYLON from "@babylon/core";
> (window as any).BABYLON = BABYLON;
> 
> ```

ah, that is a simple solution. For now that probably means the bundle will contain all of Babylon, but that is manageable.

Not getting any errors anymore, but not seeing any meshes either. Only an all white screen (which is not the clear color) so I have some work to do 🙂.  
Thanks for now.

---

<div class="post-metadata">

**Author:** ![jelster](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jelster/32/25881_2.png) [@jelster](https://forum.babylonjs.com/u/jelster)\
**Post date:** [August 21, 2021, 4:16pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/11 "2021-08-21T16:16:40Z")

</div>

Is there an issue number for this? I’d like to track this one if possible 🙂

---

<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 21, 2021, 7:02pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/12 "2021-08-21T19:02:22Z")

</div>

I have created an issue:

> <https://github.com/BabylonJS/Babylon.js/issues/10909>
>
> See https://forum.babylonjs.com/t/webgpu-init-issues/23237/8

---

<div class="post-metadata">

**Author:** ![mpaleo.meetkai](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mpaleo.meetkai/32/38624_2.png) [@mpaleo.meetkai](https://forum.babylonjs.com/u/mpaleo.meetkai)\
**Post date:** [June 12, 2024, 8:27pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/13 "2024-06-12T20:27:58Z")

</div>

Probably related. The window babylon was fixed but still seeing the “wrong mime type” error, is this something fixable in the cdn ? or should we host the glslang and twgsl ? is there a package containing those files ? so probably I’ll need a predeploy copy command

 ![Screenshot 2024-06-12 172409](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/d/bd0d6a6bd17869282a848f1e136919c56fa54898.png)

Thanks

---

<div class="post-metadata">

**Author:** ![Dad72](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/dad72/32/13_2.png) [@Dad72](https://forum.babylonjs.com/u/Dad72)\
**Post date:** [June 12, 2024, 8:35pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/14 "2024-06-12T20:35:29Z")

</div>

I have the same error in the console with :

> wasm streaming compile failed: TypeError: Failed to execute ‘compile’ on ‘WebAssembly’: Incorrect response MIME type. Expected ‘application/wasm’.

It’s a recent error that I’ve had for maybe 2 or 3 weeks, I don’t really know.

However, I load the physics engine normally :

```auto
async loadPhysic(scene) {
        const gravity = new BABYLON.Vector3(0, -12, 0);
        const havokEngine = await HavokPhysics();
        const babylonPhysicPlugin = new BABYLON.HavokPlugin(true, havokEngine);
        scene.enablePhysics(gravity, babylonPhysicPlugin);
    }

```

in htaccess :

> AddType application/wasm .wasm

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [June 12, 2024, 8:40pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/15 "2024-06-12T20:40:56Z")

</div>

cc @RaananW  
Do we have a server side issue?

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [June 12, 2024, 8:44pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/16 "2024-06-12T20:44:27Z")

</div>

Looking into that

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [June 12, 2024, 8:54pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/17 "2024-06-12T20:54:40Z")

</div>

Problem was resolved. Also fixed deployment so next nightly will work correctly as well.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [June 12, 2024, 9:00pm UTC](https://forum.babylonjs.com/t/webgpu-init-issues/23237/18 "2024-06-12T21:00:12Z")

</div>

haha I love that 😃 Problem? Yes sir, here is the solution!
