Bug from nowWhere + Bug with 4.1.0

Yup, this is two bugs I want to share with you! The two of them are linked to 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:

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:

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. :wink:

1 Like

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

1 Like

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? :wink:

1 Like

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 :eyes:)

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

1 Like

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

1 Like

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

It only occurs in Chrome also.

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

A LOT OF DEVOTION ;D

2 Likes

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

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)

Can you try with stable version on the PG?

I tried already, no luck so far.

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.

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

I just updated 4.1 my demos which are on the site of 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:


In this picture you can see missing textures and completely moving objects that are no longer on the table. I never had that before

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)

Links to the demos on babylon.com :
Evasion : Evasion
Survival: Survival V2
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.)

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 :slight_smile:

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.

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.

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

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