Failing to initialize WebGL in Chrome due to TypeError in SDK
mapbox-gl-js version: 1.6.1
browser: Google Chrome Version 80
Steps to Trigger Behavior
- Initialize Mapbox in Google Chrome
- Map fails to render on certain computers (stack trace attached as image)
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.
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 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 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 , another useful website to debug client side WebGL issues is https://webglreport.com/ , could you post what you see on that site?
@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!
@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.
@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.
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
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.
I have the same problem.
Closing since there is not enough information here to be actionable.
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.