I am developing an web app in ThreeJS (0.157.0), as part of a conversion from WebGL code, but while the scene renders in Chrome and Safari on my Mac it fails on both my iPhone and iPad, using iOS 17 (iPhone 12 Pro at 17.0.3 and iPad at iPadOS 17.03).
The failure is in the form of the console being overrun with the message:
[Error] WebGL: context lost.
[Log] THREE.WebGLRenderer: Context Lost. (chunk-HR4Q7LEE.js, line 17268)
This happens if before I add any objects (I removed them all to be sure).
Further investigation shows that this impacts AL the examples on the Three.js website, so it is not specific to my code.
I created this code which is sufficient to cause the issue:
import * as THREE from 'three';
const renderer = new THREE.WebGLRenderer( { antialias: false } );
renderer.setPixelRatio( window.devicePixelRatio );
renderer.setSize( window.innerWidth, window.innerHeight);
document.body.appendChild( renderer.domElement );
Is anyone else able to reproduce or has been able to dig to see what might be causing the issue? While we can blame iOS, I’d still prefer to see what it is in the Three.js code that is upsetting mobile Safari.
As I currently see it, it can’t be attributed to a scene using too much memory, since my example is using the bare minimum, with no objects added.
Edit: I was able to save the console log and jump to the start, where I see the following error:
[Error] WebGL: context lost.
getContext
getContext (chunk-HR4Q7LEE.js:17002)
WebGLRenderer (chunk-HR4Q7LEE.js:17029)
Module Code (mini-main.ts:2)
[Error] TypeError: null is not an object (evaluating 'gl.getShaderPrecisionFormat(gl.VERTEX_SHADER, gl.HIGH_FLOAT).precision')
getMaxPrecision (chunk-HR4Q7LEE.js:9651)
WebGLCapabilities (chunk-HR4Q7LEE.js:9665)
initGLContext (chunk-HR4Q7LEE.js:17057)
WebGLRenderer (chunk-HR4Q7LEE.js:17090)
Module Code (mini-main.ts:2)
Should I be opening a bug report at this point?