model-viewer icon indicating copy to clipboard operation
model-viewer copied to clipboard

Model Viewer fails to load on some older devices

Open LuisBoto opened this issue 1 year ago • 9 comments

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.

LuisBoto avatar Jan 24 '25 08:01 LuisBoto

Hi, what browser and what versions did you test with?

mohammadbaghaei avatar Jan 30 '25 14:01 mohammadbaghaei

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 avatar Jan 30 '25 15:01 NicoPennec

@NicoPennec

Hi there

Some features are only available over HTTPS. If your page is hosted over HTTP, that might be the issue.

mohammadbaghaei avatar Jan 31 '25 20:01 mohammadbaghaei

@mohammadbaghaei I checked the crash logs, and all the pages are in HTTPS.

NicoPennec avatar Jan 31 '25 21:01 NicoPennec

@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 avatar Feb 01 '25 05:02 mohammadbaghaei

@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.

NicoPennec avatar Feb 02 '25 21:02 NicoPennec

@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.

LuisBoto avatar Feb 03 '25 09:02 LuisBoto

I share a simple way to reproduce the issue on a Chrome desktop browser: disable hardware acceleration. I hope this helps!

  1. Go to chrome://settings/system
  2. Turn on Use hardware acceleration when available
  3. Click on Relaunch

NicoPennec avatar Jul 16 '25 09:07 NicoPennec