mapbox-gl-js icon indicating copy to clipboard operation
mapbox-gl-js copied to clipboard

Failing to initialize WebGL in Chrome due to TypeError in SDK

Open cyorobert opened this issue 6 years ago • 11 comments

mapbox-gl-js version: 1.6.1

browser: Google Chrome Version 80

Steps to Trigger Behavior

  1. Initialize Mapbox in Google Chrome
  2. Map fails to render on certain computers (stack trace attached as image)

mapbox_stack_trace

Troubleshooting steps taken thus far:

  • Chrome Version: Chrome 80
  • WebGL enabled + Hardware Accelerated: verified via chrome://gpu
  • "Use hardware acceleration when possible": verified via Chrome > Settings > Advanced > System
  • Diagnostic test https://mapbox.github.io/mapbox-gl-supported/diagnostics.html produces TypeError cannot read property resize of undefined at e.resize

Link to Demonstration

I've attached a screenshot including the stack trace of the error in addition to the output of https://mapbox.github.io/mapbox-gl-supported/diagnostics.html from an affected user's computer.

mapbox error message Page 2 mapbox error message (1)

Expected Behavior

Mapbox renders successfully in Google Chrome

Actual Behavior

The Mapbox map does not render and throws an exception indicating that it failed to initialize WebGL.

cyorobert avatar Feb 24 '20 19:02 cyorobert

@cyorobert You report that this is happening in 1.6.1 but in the error shown in the diagnostic screenshot, I see 0.34.0 which is a very old version. Are you sure this is being encountered on a newer version of GL JS?

ryanhamley avatar Feb 24 '20 20:02 ryanhamley

@ryanhamley Thanks for the response. I'm certain that the screenshot from our user's Chrome console that shows the stack trace is running 1.6.1. I didn't see an option to run the diagnostic tool with a different version, so it's entirely possible it's a separate error.

cyorobert avatar Feb 24 '20 21:02 cyorobert

@cyorobert , another useful website to debug client side WebGL issues is https://webglreport.com/ , could you post what you see on that site?

arindam1993 avatar Feb 24 '20 21:02 arindam1993

@arindam1993 Yes, I'll ask our customer to send me what they see on webglreport.com. I'm unable to replicate the issue on my computer. I'll follow up when I hear back. Thanks!

cyorobert avatar Feb 24 '20 22:02 cyorobert

@arindam1993 @ryanhamley I asked our user to take screenshots of the output from webglreport.com (see below). Interestingly, chrome://gpu reports that WebGL 1 & 2 are enabled with hardware acceleration, so I suspect it may be related to the video drivers. Do you have any experience troubleshooting video driver issues? What would you recommend my next troubleshooting steps be?

It's also worth noting that this application is working fine in Internet Explorer and Edge.

Tab 2 Tab 1

cyorobert avatar Feb 25 '20 15:02 cyorobert

@cyorobert Do these users have fingerprint-tracking blockers or tabs with 15+ GL contexts already active? These are other cases where we have seen the failure to acquire a GL context.

asheemmamoowala avatar Feb 25 '20 19:02 asheemmamoowala

You could ask the user to run dxdiag in the windows run menu (WIN key + R) and look at the report to diagnose driver issues.

Its also possible this particular GPU is a part of chrome's GPU blacklist. https://chromium.googlesource.com/chromium/src/gpu/+/master/config/software_rendering_list.json

Its possible to skip the blacklist by setting Override Software Rendering List to enabled in chrome://flags

arindam1993 avatar Feb 26 '20 23:02 arindam1993

Thanks for the feedback. I'm currently trying to get in touch with their IT team to see if we can dive deeper into some of these settings. I'll post an update here when I find out what's going on.

cyorobert avatar Mar 10 '20 14:03 cyorobert

I have the same problem.

luccasfraga avatar May 04 '20 17:05 luccasfraga

Closing since there is not enough information here to be actionable.

asheemmamoowala avatar Oct 27 '21 16:10 asheemmamoowala

I occasionally see this error, but I'm also unable to recreate it, and we haven't had any complaints from users about not seeing the map.

But if it helps, my app is currently using latest (2.14.1). The latest one that I just saw come through today was from a user using mac os x 10.15: Full user agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36

Here's the line number of the minified mapbox-gl.js if it helps:

{
      "source": "webpack:///node_modules/mapbox-gl/dist/mapbox-gl.js",
      "line": 36,
      "column": 452617,
      "name": null
    },

I'm just going to ignore the error for now, tbh.

JohnnyFun avatar May 11 '23 17:05 JohnnyFun