I tried already in PG without success. We disabled webgl 2 because of some issues on some devices.
Maybe this is the diffrence. Is it possible to force PG to use only WebGL 1?
Yes you can define the createEngine function if I remember correct @sebavan?
Yup we fixed it a week ago 
I tried my best to reproduce the error in playground but without success. Still getting this error randomly in our app when loading objects:
Uncaught TypeError: Cannot read property ‘0’ of undefined
at Effect…/Materials/effect.ts.Effect.getAttributeLocation (babylon.max.js:87400)
at Engine…/Engines/thinEngine.ts.ThinEngine._bindVertexBuffersAttributes (babylon.max.js:39409)
at Engine…/Engines/thinEngine.ts.ThinEngine.recordVertexArrayObject (babylon.max.js:39446)
at Geometry…/Meshes/geometry.ts.Geometry._bind (babylon.max.js:112331)
at Mesh…/Meshes/mesh.ts.Mesh._bind (babylon.max.js:115752)
at Mesh…/Meshes/mesh.ts.Mesh.render (babylon.max.js:116067)
at SubMesh…/Meshes/subMesh.ts.SubMesh.render (babylon.max.js:121533)
at RenderingGroup…/Rendering/renderingGroup.ts.RenderingGroup.renderUnsorted (babylon.max.js:161594)
at RenderingGroup…/Rendering/renderingGroup.ts.RenderingGroup.render (babylon.max.js:161495)
at RenderingManager…/Rendering/renderingManager.ts.RenderingManager.render (babylon.max.js:161856)
Our codebase is also to big to create a small example with this problem. ![]()
… i lookad a bit at the BabylonJs code. The problem is that at the time an effect gets rendered it happens that its this._attributes member is still undefined. That means the _prepareEffect() function wasn’t finished but the effect counts as isReady already.
If you take a look at the _isReadyInternal() function here: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/effect.ts#L303
you will see that the effect relies on the ready state of the _pipelineContext if the effect itself is not ready yet. Theoretically it could happen that the _pipelineContext says that it is ready but the compile callback inside _prepareEffect() didn`t get executed yet: https://github.com/BabylonJS/Babylon.js/blob/master/src/Materials/effect.ts#L545
does that make sense? ![]()
Well I don’t see how (but I agree as you have the issue it may happen :)) as the engine will call the finalizePipelineContext BEFORE returning the readystate:
which in turn will call the the _executeWhenRenderingStateIsCompiled which will set the attributes
Unfortunately without a repro I can’t help more
Maybe you can set a breakpoint on the _executeWhenRenderingStateIsCompiled function and trace what is happening?
Check the other discussion: I may have a fix