# RenderTargetTexture: Maximum call stack size exceeded during render list changing

**URL:** <https://forum.babylonjs.com/t/rendertargettexture-maximum-call-stack-size-exceeded-during-render-list-changing/33860>\
**Category:** Bugs\
**Tags:** render-target\
**Created:** [September 12, 2022, 9:41am UTC](https://forum.babylonjs.com/t/rendertargettexture-maximum-call-stack-size-exceeded-during-render-list-changing/33860 "2022-09-12T09:41:52Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![zephyrol](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zephyrol/32/21021_2.png) [@zephyrol](https://forum.babylonjs.com/u/zephyrol)\
**Post date:** [September 12, 2022, 9:41am UTC](https://forum.babylonjs.com/t/rendertargettexture-maximum-call-stack-size-exceeded-during-render-list-changing/33860/1 "2022-09-12T09:41:52Z")

</div>

Hello everyone,

I hope you are doing well.

Since version 5.23.0: [Release 5.23.0 · BabylonJS/Babylon.js · GitHub](https://github.com/BabylonJS/Babylon.js/releases/tag/5.23.0), I got a call stack size exceeded when I changed the render list of a render target:

```auto
VM3339:3 RangeError: Maximum call stack size exceeded
    at Proxy.hasOwnProperty (<anonymous>)
    at ArrayTools.MakeObservableArray (arrayTools.ts:86:62)
    at set renderList [as renderList] (renderTargetTexture.ts:81:28)

```

This render list is changed several times in render loop, so the bug appears after about 30 seconds of using.  
I guess that it’s related to this commit: [Fix scene not clearing in some Default Rendering Pipeline with multic… · BabylonJS/Babylon.js@5322d44 · GitHub](https://github.com/BabylonJS/Babylon.js/commit/5322d44416f70c80ad364d7109cba078c95399a5)

I hope that those information will help you.

Have a nice day !  
zephyrol

---

<div class="post-metadata">

**Author:** ![RaananW](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/raananw/32/28955_2.png) [@RaananW](https://forum.babylonjs.com/u/RaananW)\
**Post date:** [September 12, 2022, 11:08am UTC](https://forum.babylonjs.com/t/rendertargettexture-maximum-call-stack-size-exceeded-during-render-list-changing/33860/2 "2022-09-12T11:08:28Z")

</div>

@carolhmj - this seems to be related to the array-changed proxy. Want to check that?

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [September 12, 2022, 11:24am UTC](https://forum.babylonjs.com/t/rendertargettexture-maximum-call-stack-size-exceeded-during-render-list-changing/33860/3 "2022-09-12T11:24:48Z")

</div>

Assigned @carolhmj on September 12, 2022, 11:24am UTC



---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [September 12, 2022, 12:53pm UTC](https://forum.babylonjs.com/t/rendertargettexture-maximum-call-stack-size-exceeded-during-render-list-changing/33860/4 "2022-09-12T12:53:34Z")

</div>

@zephyrol would you have a Playground repro of this? 🙂

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [September 14, 2022, 12:51pm UTC](https://forum.babylonjs.com/t/rendertargettexture-maximum-call-stack-size-exceeded-during-render-list-changing/33860/5 "2022-09-14T12:51:09Z")

</div>

We have a PR up now to improve the render target listening functions, this should avoid this problem 🙂 [Fix Array Observers by sebavan · Pull Request #12982 · BabylonJS/Babylon.js (github.com)](https://github.com/BabylonJS/Babylon.js/pull/12982)  
Thank you very much to @sebavan 's programming wisdom 🙂

---

<div class="post-metadata">

**Author:** ![carolhmj](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/carolhmj/32/25918_2.png) [@carolhmj](https://forum.babylonjs.com/u/carolhmj)\
**Post date:** [September 14, 2022, 12:51pm UTC](https://forum.babylonjs.com/t/rendertargettexture-maximum-call-stack-size-exceeded-during-render-list-changing/33860/6 "2022-09-14T12:51:13Z")

</div>

Unassigned @carolhmj on September 14, 2022, 12:51pm UTC



---

<div class="post-metadata">

**Author:** ![zephyrol](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/zephyrol/32/21021_2.png) [@zephyrol](https://forum.babylonjs.com/u/zephyrol)\
**Post date:** [September 15, 2022, 1:05pm UTC](https://forum.babylonjs.com/t/rendertargettexture-maximum-call-stack-size-exceeded-during-render-list-changing/33860/7 "2022-09-15T13:05:29Z")

</div>

Hello !

I tried the new version 5.24.0 and I confirm the bug is fixed thank you very much !

Have a nice day.  
zephyrol
