# TypeError: Failed to execute 'texImage2D' on 'WebGL2RenderingContext': Overload resolution failed

**URL:** <https://forum.babylonjs.com/t/typeerror-failed-to-execute-teximage2d-on-webgl2renderingcontext-overload-resolution-failed/27678>\
**Category:** Bugs\
**Created:** [February 15, 2022, 3:33pm UTC](https://forum.babylonjs.com/t/typeerror-failed-to-execute-teximage2d-on-webgl2renderingcontext-overload-resolution-failed/27678 "2022-02-15T15:33:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [February 15, 2022, 3:33pm UTC](https://forum.babylonjs.com/t/typeerror-failed-to-execute-teximage2d-on-webgl2renderingcontext-overload-resolution-failed/27678/1 "2022-02-15T15:33:52Z")

</div>

I was seeing this error before in the past months, but I had no idea where it was coming from.  
Now I tried to simulate webgl context lost/restored for the first time in a while and that’s when I got it locally:

 ![image](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/0/9/096ea163a391a851b6dc19ae1f6a4cac8845485b.png)

I’m on version 5.0.0-beta.6, but expect it to be in there from the alpha on as well…

this is the code I use to simulate, it happens after the restoreContext call.

```
    const loseContext = engine.babylonScene.getEngine()._gl.getExtension('WEBGL_lose_context')!;
    void System.delay(10000).then(() => loseContext.loseContext());
    void System.delay(11000).then(() => loseContext.restoreContext());

```

I will see if I can playground it later when I have time.

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [February 15, 2022, 4:20pm UTC](https://forum.babylonjs.com/t/typeerror-failed-to-execute-teximage2d-on-webgl2renderingcontext-overload-resolution-failed/27678/2 "2022-02-15T16:20:40Z")

</div>

Yes please, provide a PG so we can have a look

---

<div class="post-metadata">

**Author:** ![mise](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/mise/32/37506_2.png) [@mise](https://forum.babylonjs.com/u/mise)\
**Post date:** [February 16, 2022, 11:37am UTC](https://forum.babylonjs.com/t/typeerror-failed-to-execute-teximage2d-on-webgl2renderingcontext-overload-resolution-failed/27678/3 "2022-02-16T11:37:00Z")

</div>

I located the issue, and it’s not a bug in Babylon, so we’re good!

(maybe the error message could be improved, not sure!)

If you’re interested:

> **[Babylon.js Playground](https://www.babylonjs-playground.com/#5ZCGRM%232295)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes
