# Pavlovia error: 'Maximum call stack size exceeded'

**URL:** <https://discourse.psychopy.org/t/pavlovia-error-maximum-call-stack-size-exceeded/20746>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [February 24, 2021, 1:34pm UTC](https://discourse.psychopy.org/t/pavlovia-error-maximum-call-stack-size-exceeded/20746 "2021-02-24T13:34:51Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![KLH](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@KLH](https://discourse.psychopy.org/u/KLH)\
**Post date:** [February 24, 2021, 1:34pm UTC](https://discourse.psychopy.org/t/pavlovia-error-maximum-call-stack-size-exceeded/20746/1 "2021-02-24T13:34:52Z")

</div>

Description of the problem: Error half way through experiment before text-based trials.

Hello!

When piloting my experiment on Pavlovia it returns the error message: RangeError: Maximum call stack size exceeded

The first part of the experiment is a series of images which runs fine, however the error occurs once it reaches a point where a series of words are supposed to be presented. The experiment works with no issues on psychopy.

This is the first experiment I’ve programmed and very new to this, so apologies if I am missing any important information!

Thank you!

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [February 26, 2021, 4:43pm UTC](https://discourse.psychopy.org/t/pavlovia-error-maximum-call-stack-size-exceeded/20746/2 "2021-02-26T16:43:21Z")

</div>

Was there any more detail on the error message? Copy/paste helps to provide all the information.

Other things to debug:

- do you have code components or anything else unusual? Inspect them more deeply
- are there part of the study that when you remove them the problem goes away? They’re to focus on
- ultimately, if you can provide a minimal working example (MEW) of the problem occurring (ie. if the first part of your study isn’t relevant then a MWE should not include that first part) then people are more likely to be able to help you

---

<div class="post-metadata">

**Author:** ![KLH](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@KLH](https://discourse.psychopy.org/u/KLH)\
**Post date:** [March 2, 2021, 4:33pm UTC](https://discourse.psychopy.org/t/pavlovia-error-maximum-call-stack-size-exceeded/20746/3 "2021-03-02T16:33:50Z")

</div>

Hi Jon, thanks for your response!

There are no code components or anything unusual.

The exact error reads as:  
Unfortunately we encountered the following error:  
**RangeError: Maximum call stack size exceeded**  
Try to run the experiment again. If the error persists, contact the experiment designer.

Here is a link to the problematic section of the study:  
[https://run.pavlovia.org/kaitclark/gs\_mem](https://run.pavlovia.org/kaitclark/gs_mem)

Thanks 🙂

---

<div class="post-metadata">

**Author:** ![jon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jon/32/22_2.png) [@jon](https://discourse.psychopy.org/u/jon)\
**Post date:** [March 2, 2021, 6:06pm UTC](https://discourse.psychopy.org/t/pavlovia-error-maximum-call-stack-size-exceeded/20746/4 "2021-03-02T18:06:37Z")

</div>

OK, that was interesting. I stripped down the components (remember I said about _minimal working example_ of the error) and ended up just with your text components called `left_` and `right_`. By then the script was small enough that I could view what was going on in the script. Weirdly, `left_` and `right_` did not exist there!

So, it turns out that when the JS code is being generated the final underscore was being removed when the code is generated! That meant there was a clash between the variable `left` and the text object `left` which recursively tried to set itself to itself!

So, I need to work out why your underscore was being removed but the workaround at your end is to call the text Component something like `left_txt` rather than `left_`

---

<div class="post-metadata">

**Author:** ![KLH](https://avatars.discourse-cdn.com/v4/letter/k/f07891/32.png) [@KLH](https://discourse.psychopy.org/u/KLH)\
**Post date:** [April 6, 2021, 10:54am UTC](https://discourse.psychopy.org/t/pavlovia-error-maximum-call-stack-size-exceeded/20746/5 "2021-04-06T10:54:41Z")

</div>

Apologies for the massively delayed reply, thank you very much that did the trick!
