Error creating WebGL context. Three js chrome?

Viewed 15958

Hi I'm getting the error

Error creating WebGL context.
Uncaught TypeError: Cannot read property 'getExtension' of null

This is happening on google chrome 71 but I find it odd because if I open up dev tool and refresh the page it works perfectly fine I'm at a loss to what is causing this any idea's ?

It's worked perfectly fine untill today nothing has changed on the PC or browser. My drivers are all up to date, webgl is enabled...

9 Answers

I'll leave this here for anyone else apparently it's a browser and graphic card issue

mrdoob: The graphics card is only one of the reasons why the context can't be created

https://github.com/mrdoob/three.js/issues/4927

This seems to be why unless anyone else has any other ideas... The issue is on going and not fixed it would be interesting to know why this happens though and why opening dev tools and refreshing resolves the issue for me.

EDIT- Apparently for me this was due to my graphic card being blacklisted because it's old.

if you have two GPU installed on your system you might want to try to enable Override software rendering list in chrome://flags/

The fix for me was manually enabling WebGL acceleration under Chrome’s feature flags: chrome://flags/

I have encountered this several times with THREE.js. It arises for me once memory resources are shared, abandoned, or overwhelmed, for example:

  1. I have a good render loop but then I introduce long tasks.
  2. I perform extensive, continuous testing. As I modify live settings in Chrome Inspector, THREE does not reflect all changes without fail. Memory may not be released until I restart.
  3. I leave the program running overnight. The next morning the browser is froze, black, OOM...
  4. I use multiple instances of a resource, for example Web Audio and Magenta Music. The quality may perceptibly degrade and throw its own errors, but... I will also encounter worse silent errors. For example when I also steam music in another tab, or click audio/video media on Twitter... frozen browser, black screen, WebGL context loss.

I updated my graphic drivers (NVIDIA) and didn't restart chrome nor the PC, and was having this issue.

I just restarted the PC and now it's fine.

I just wanted to comment that I saw this due to other unrelated errors in my app that got thrown first.

This was resolved for me by simply installing the latest and restarting my browser - thought I'd add it here to hopefully save some future soul from wasting an hour like i did.

Error creating webGL Context in three.js.min ver 93 I had the same problem with Chrome version 104.5112.102 and managed to fix it by going to Chrome, Settings, and switching off the Use hardware acceleration when available. the graphics card is an old GE Force 8600 card running on Windows 10.

For me, I restarted my computer and the error did not appear again. You can try doing this before you do anything more complicated.

Related