# Bug from nowWhere + Bug with 4.1.0

**URL:** <https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061>\
**Category:** Bugs\
**Created:** [August 13, 2019, 6:23am UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061 "2019-08-13T06:23:54Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)\
**Post date:** [August 13, 2019, 6:23am UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/1 "2019-08-13T06:23:54Z")

</div>

Yup, this is two bugs I want to share with you! The two of them are linked to [https://wazana.io](https://wazana.io) project

I noticed last week the game was not working anymore. As you can see in the console there is this new error showing up:

```auto
Uncaught TypeError: this._caps.parallelShaderCompile.maxShaderCompilerThreadsKHR is not a function
    at n._initGLContext (engine.782c13b0.js:sourcemap:16)
    at new n (engine.782c13b0.js:sourcemap:16)
    at Object.exports.launchBabylon (engine.782c13b0.js:sourcemap:26)
    at window.onload (engine.782c13b0.js:sourcemap:360)

```

It really came from nowhere and I can’t really solve it by myself. The online page is using version 4.0.0-alpha.8 but I get the same result with stable version 4.0.3  
So I decided to make an update of BabylonJS, but then I get this error message with last version 4.1.0-alpha.14:

```auto
scene.ts:3365 Uncaught TypeError: mesh.scaling.lengthSquared is not a function
    at Scene._evaluateActiveMeshes (scene.ts:3365)
    at Scene._renderForCamera (scene.ts:3524)
    at Scene._processSubCameras (scene.ts:3622)
    at Scene.render (scene.ts:3886)
    at scene.ts:194
    at Engine._renderLoop

```

I really want to find out which stuff I am using is the source of that error but errors happening in the render function can be hard to solve. For instance is there a way here to console the mesh which is creating the error? It doesn’t work with try/catch.

Thanks for your help. 😉

---

<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 13, 2019, 2:46pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/2 "2019-08-13T14:46:00Z")

</div>

the 4.0 issue comes from a change in Chrome regarding shader compilation. The spec evolved. So moving to 4.1 is a good idea

For your 4.1 bug, simply set a breaking at Scene.\_evaluateActiveMeshes (scene.ts:3365) or even better set your f12 debugger to break on all exception so the debugger will be triggered when the error will be hit

---

<div class="post-metadata">

**Author:** ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)\
**Post date:** [August 13, 2019, 7:59pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/3 "2019-08-13T19:59:15Z")

</div>

Thanks, the “break on all exception” is very useful indeed!

I can confirm the mesh which triggers the error is a sphere which has been cloned. If I create an instance instead, I don’t get the error but I need a clone in my case.  
I can’t reproduce the error in the playground but does that ring a bell? 😉

---

<div class="post-metadata">

**Author:** ![Rah](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/rah/32/201_2.png) [@Rah](https://forum.babylonjs.com/u/Rah)\
**Post date:** [August 13, 2019, 7:59pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/4 "2019-08-13T19:59:45Z")

</div>

is upgrading to 4.1 the only option?  
I stuck with the version im on for a few reason, it would cause a large amount of work for me to update to 4.1…

edit: i only have the problem with the chrome evolution

also since when are you a sith overlord and (how can i be your sith apprentice 👀)

---

<div class="post-metadata">

**Author:** ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)\
**Post date:** [August 13, 2019, 8:05pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/5 "2019-08-13T20:05:40Z")

</div>

> [@Rah](#):
>
> also since when are you a sith overlord and (how can i be your sith apprentice 👀)

It takes times, practice and devotion, right @Deltakosh? ! 😂

---

<div class="post-metadata">

**Author:** ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)\
**Post date:** [August 13, 2019, 8:11pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/6 "2019-08-13T20:11:07Z")

</div>

> [@PichouPichou](#):
>
> I can’t reproduce the error in the playground but does that ring a bell?

Ok it ringed a bell to me! I was just setted a wrong scaling value at some point!

---

<div class="post-metadata">

**Author:** ![PichouPichou](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pichoupichou/32/316_2.png) [@PichouPichou](https://forum.babylonjs.com/u/PichouPichou)\
**Post date:** [August 13, 2019, 8:36pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/7 "2019-08-13T20:36:34Z")

</div>

Hum I don’t know if it is linked to what @Rah expressed but I got other error which seems to be also linked to shaders:

> Cannot read property ‘getProgramParameter’ of undefined  
> coming from this line:  
> [https://github.com/BabylonJS/Babylon.js/blob/master/src/Engines/engine.ts#L3374](https://github.com/BabylonJS/Babylon.js/blob/master/src/Engines/engine.ts#L3374)

It only occurs in Chrome also.

---

<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 14, 2019, 1:24am UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/8 "2019-08-14T01:24:49Z")

</div>

unfortunately without a repro I can’t help a lot  
The PG can use previous version when setting the version dropdown to stable

---

<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 14, 2019, 1:26am UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/9 "2019-08-14T01:26:01Z")

</div>

> [@PichouPichou](#):
>
> It takes times, practice and devotion,

A LOT OF DEVOTION ;D

---

<div class="post-metadata">

**Author:** ![Kesshi](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@Kesshi](https://forum.babylonjs.com/u/Kesshi)\
**Post date:** [August 14, 2019, 7:17am UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/10 "2019-08-14T07:17:36Z")

</div>

We also get errors with the latest chrome. I couldn’t reproduce it in PG yet. 😟

> babylon.js?v=1565697061647:formatted:5003 Uncaught TypeError: Cannot read property ‘0’ of undefined  
> at e.getAttributeLocation (babylon.js?v=1565697061647:formatted:5003)  
> at e.\_bindVertexBuffersAttributes (babylon.js?v=1565697061647:formatted:8379)  
> at e.recordVertexArrayObject (babylon.js?v=1565697061647:formatted:8400)  
> at e.\_bind (babylon.js?v=1565697061647:formatted:24995)  
> at t.\_bind (babylon.js?v=1565697061647:formatted:11005)  
> at t.render (babylon.js?v=1565697061647:formatted:11156)  
> at t.render (babylon.js?v=1565697061647:formatted:24053)  
> at e.renderUnsorted (babylon.js?v=1565697061647:formatted:76510)  
> at e.render (babylon.js?v=1565697061647:formatted:76455)  
> at e.render (babylon.js?v=1565697061647:formatted:28732)

---

<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 14, 2019, 2:43pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/11 "2019-08-14T14:43:27Z")

</div>

Can you try with stable version on the PG?

---

<div class="post-metadata">

**Author:** ![Kesshi](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@Kesshi](https://forum.babylonjs.com/u/Kesshi)\
**Post date:** [August 15, 2019, 6:11am UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/12 "2019-08-15T06:11:30Z")

</div>

I tried already, no luck so far.

---

<div class="post-metadata">

**Author:** ![Kesshi](https://avatars.discourse-cdn.com/v4/letter/k/b782af/32.png) [@Kesshi](https://forum.babylonjs.com/u/Kesshi)\
**Post date:** [August 15, 2019, 6:20am UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/13 "2019-08-15T06:20:30Z")

</div>

How can i disable webgl 2 support in playground?  
I don’t know if this is related but we disabled webgl2 in our app because we encountered some problems on some devices.  
I also tried to enable wegl 2 today for our app to test it in the latest chrome. I didn’t get an error but some of the materials were black. So its something related to materials/shader compilation.

---

<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:** [August 15, 2019, 11:22am UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/14 "2019-08-15T11:22:24Z")

</div>

I had this problem recently and it was due to the use of too big texture that did not load fast enough. The texture became black. When I resize the textures, it works.

I had this error too:  
this.\_caps.parallelShaderCompile.maxShaderCompilerThreadsKHR  
This is correct by updating to babylon 4.1

---

<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:** [August 15, 2019, 2:58pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/15 "2019-08-15T14:58:07Z")

</div>

I just updated 4.1 my demos which are on the site of [Babylon.com](http://Babylon.com).

Result some textures are black (PNG, JPG…) other transparent (DDS), I think because they are too big (1024 or 2048) (but before that worked well)

Here are in pictures:

 ![2019-08-15%2016_25_29-Greenshot](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/2/2652e71c8430a471b39361fce55c90c9b2dcbc73.jpeg)  
In this picture you can see missing textures and completely moving objects that are no longer on the table. I never had that before  
 ![2019-08-15%2016_38_20-Greenshot](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/1/17dd6b70abef6b9d156d952aa0c6ee69f7247545.jpeg)  
Here, It’s random, sometimes the water is black and sometimes not, but I also have this random error in the console: (TypeError: Cannot read property ‘0’ of undefined)  
 ![2019-08-15%2016_54_28-Greenshot](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/c/c73d2eb2efc5d55e0636aba2b22d96a97d2e2f69.jpeg)  
 ![2019-08-15%2016_30_06-Greenshot](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/2X/4/40a220970f04d3f88c919240789be2689d23a41e.jpeg)

Links to the demos on [babylon.com](http://babylon.com) :  
**Evasion** : [Evasion](http://www.babylon.actifgames.com/Evasion/index.html)  
**Survival** : [Survival V2](http://www.babylon.actifgames.com/Survival/index.php)  
On the demo of Survival before, the camera was close to the character, now I load, she is very far away ???. (It’s an arcRotateCamera.)

---

<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 15, 2019, 3:10pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/16 "2019-08-15T15:10:05Z")

</div>

What I need to fix issues is to get a repro that I can use: something on the PG and as always it will be fixed immediatly 🙂

---

<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:** [August 15, 2019, 3:14pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/17 "2019-08-15T15:14:06Z")

</div>

I do not see how I can reproduce complete demos on the PG. I do not have a PG example to reproduce that and I do not know what causes them.

The demos are on site babylon, she have been there for several years without having her problems.

---

<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:** [August 15, 2019, 3:20pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/18 "2019-08-15T15:20:13Z")

</div>

I just tried it on other browser saying it may be a problem with Google Chrome, but I have the same thing on Firefox and Opera.

---

<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 15, 2019, 3:20pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/19 "2019-08-15T15:20:16Z")

</div>

Yes but you are a developer, you know that it is almost impossible to fix an issue without a decent repro. I cannot spend a week digging into your code where it will be really easy for you to create simple one for me. You can easily isolate the meshes that have an issue and drop them either on the playground or at least on a page referencing babylon.max.js

---

<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 15, 2019, 3:35pm UTC](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061/20 "2019-08-15T15:35:58Z")

</div>

For instance I go to your survival website and it works with no issue. Cannot repro the problem.  
Tested on firefox and chrome

[Next page](https://forum.babylonjs.com/t/bug-from-nowwhere-bug-with-4-1-0/5061.md?page=2)
