Model Viewer fails to load on some older devices
When trying to load model viewer on some old or low end devices (tried an old laptop with intel graphics, a colleague also reported the same behaviour on their 2014 mac, among others) the ARRenderer class fails with an error:
Uncaught TypeError: this.threeRenderer is undefined
Which seems to come from line:
this.threeRenderer.xr.enabled = true;
Could be related to #4972 as the error looks similar. Nothing displays on the page at all after it fails, and the machines I tested seem able to run threeJS just fine otherwise. I managed to reproduce the error on my setup by using a small win7 container using the dockurr/windows Docker image.
Hi, what browser and what versions did you test with?
I am encountering the same issue according to my Sentry crash logs across various browsers:
- Safari 14.1.2
- Firefox 134.0
- Chrome 109.0.0, 116.0.0, 125.0.0, 131.0.0, 132.0.0
The stack trace:
TypeError: Cannot read properties of undefined (reading 'xr')
Error: Error creating WebGL context.
THREE.WebGLRenderer: Error creating WebGL context.
THREE.WebGLRenderer: A WebGL context could not be created. Reason: Failed to create a WebGL2 context.
My npm dependencies are:
"@google/model-viewer": "4.0.0",
"three": "0.172.0",
@NicoPennec
Hi there
Some features are only available over HTTPS. If your page is hosted over HTTP, that might be the issue.
@mohammadbaghaei I checked the crash logs, and all the pages are in HTTPS.
@NicoPennec I just tested this on:
- Xiaomi 12x 📱
- Galaxy S24 Ultra 📱
- Galaxy A23 & A15 📱
Everything works smoothly on these devices! ✔️
Could you check if Google Play Services for AR is pre-installed on your test devices?
@mohammadbaghaei Thanks for the test, but the issue is on desktop only as explained @LuisBoto, not on android devices.
In my users crash logs, I can see Windows >= 10 and Mac OS X >=10.15.7.
@mohammadbaghaei Thanks for the test, but the issue is on desktop only as explained @LuisBoto, not on android devices.
In my users crash logs, I can see Windows >= 10 and Mac OS X >=10.15.7.
Indeed, as @NicoPennec points out this seems to be mostly a Desktop issue. So far I haven't been able to reproduce the error on mobile devices.
I share a simple way to reproduce the issue on a Chrome desktop browser: disable hardware acceleration. I hope this helps!
- Go to
chrome://settings/system - Turn on
Use hardware acceleration when available - Click on
Relaunch