22

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

12 Answers 12

17

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

Sign up to request clarification or add additional context in comments.

2 Comments

This made it for me ! I do not have 2 GPU, just running chromium in a Debian VM and this solved it !
Worked for me. And continued to work even after disabling it.
10

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.

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

2 Comments

I am getting this error in Chrome: "THREE.WebGLRenderer: Error creating WebGL context." but it works fine in Firefox.
Same here. Works fine in Firefox not in Chrome. Older Macbook Pro With integrated graphics, but never had problems before..
7

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

Comments

7
  1. Go to your chrome://settings/
  2. Click on System, on the left side panel
  3. Turn on "Use hardware acceleration when available"
  4. Click "Relaunch"

Good luck!

1 Comment

Solution worked for me, m1 mbp, chrome 129.0.6668.70, had the google maps zoom in bug!
5

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 stream music in another tab, or click audio/video media on Twitter... frozen browser, black screen, WebGL context loss.

Comments

3

I was able to get this working using the following:

Go to chrome://flags/

  1. Override Software Rendering List... [X]enabled
  2. WebGL Developer Extensions... [X]enabled
  3. WebGL Draft Extensions... [X]enabled

Then in settings:

  1. Use Graphics Acceleration When Available... [X]enabled

Comments

2

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.

Comments

1

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.

Comments

0

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.

1 Comment

Installing the latest chrome version?
0

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

Comments

0

For anyone having this problem, it has to do with the Google Chrome browser, what you have to do is click on the three dots on the top right in the browser, and look for settings. There you open the settings and put "Hardware Acceleration" in the search box, activate the switch, and click "Restart".

Comments

0

Remember to ensure that webGL is available before start TresJS:

function isWebGLAvailable() {
  try {
    const canvas = document.createElement('canvas');
    return !!(
      window.WebGLRenderingContext &&
      (canvas.getContext('webgl') || canvas.getContext('experimental-webgl'))
    );
  } catch (e) {
    return false;
  }
} 

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.