Webgl_context_loss

So I wake up this morning & find that I had a WEBGL_CONTEXT_LOSS error in my console log. How to fix? :frowning:

From my understanding, you can’t prevent it. This is your browser thinking that you don’t need it or there are too many WebGL contexts running so it is trying to reclaim the resources. WebGL is a gigantic resource hog to the browser.

It isn’t actually an error in your code. All you can do is ask for the context back or destroy and recreate the context.

EDIT: Rereading your post, it sounds like perhaps you left the context on overnight and saw this error in the morning? If so, then I don’t think you have anything to be concerned about. Your browser will definitely try to clean up a WebGL context left open and untouched for hours.

How do I ask for the context back?

Phaser already attempts this automatically from my understanding. If you see the error, I think all you can do is destroy and recreate.

Did this happen after you left the WebGL canvas open overnight?

Yes.

Then I wouldn’t even worry about it. This is just the browser doing what it is supposed to do.