# My psychojs code won't allow data to save in Pavlovia

**URL:** <https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443>\
**Category:** Online experiments\
**Tags:** online, pavlovia\
**Created:** [January 10, 2025, 4:10pm UTC](https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443 "2025-01-10T16:10:29Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![gal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/gal/32/43915_2.png) [@gal](https://discourse.psychopy.org/u/gal)\
**Post date:** [January 10, 2025, 4:10pm UTC](https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443/1 "2025-01-10T16:10:29Z")

</div>

Description of the problem: hey! i recently converted some javascript code into psychojs format to run an online experiment through pavlovia (i am very new to javascript/psychojs). while my experiment runs locally and in pavlovia, none of my data saves in pavlovia. experiments all fall under the “aborted” category (despite piloting/running the experiment to completion) and when i download the results, i get a completely empty folder. wondering if anyone may have any tips/suggestions that might help. for context, the saved data should include participant id and the urls visited by participants. i will attach my code. thanks in advance!  
[index (1).html.zip](https://discourse.psychopy.org/uploads/short-url/9WwuxXcB0kT9wFjfHogmla9fVOO.zip) (2.2 KB)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [January 10, 2025, 5:10pm UTC](https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443/2 "2025-01-10T17:10:19Z")

</div>

Are your participants ending your experiment by pressing the escape key?

> [@Wakefield's Daily Tips](https://discourse.psychopy.org/t/wakefields-daily-tips/43371/8):
>
> Exit cleanly Locally you might want your participant to end on a thank you screen rather than being sent back to the PsychoPy Builder. Unfortunately, this desire has encouraged a bad habit of leaving the final message on screen and then pressing the escape button to exit. While data is saved locally after escape has been pressed, until recently microphone recordings were not. My recommendation would be to have the final screen end on a key press that you have not told the participant, e.g. ‘q’. …

---

<div class="post-metadata">

**Author:** ![gal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/gal/32/43915_2.png) [@gal](https://discourse.psychopy.org/u/gal)\
**Post date:** [January 10, 2025, 6:00pm UTC](https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443/3 "2025-01-10T18:00:28Z")

</div>

No - participants are just left on a “thank you for participating” page and should just be able to exit the browser tab.

---

<div class="post-metadata">

**Author:** ![gal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/gal/32/43915_2.png) [@gal](https://discourse.psychopy.org/u/gal)\
**Post date:** [January 10, 2025, 6:30pm UTC](https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443/4 "2025-01-10T18:30:08Z")

</div>

I also tried adding a q press and same result of not saving. Here are some of the errors i get.

 ![Screenshot 2025-01-10 at 1.29.17 PM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/0/4/049bed36617d0bcbac4a1fb220ff4728a6f1916d.png)  
 ![Screenshot 2025-01-10 at 1.29.06 PM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/d/f/dfcd8994caca799716baa0708840e9b39b372535.png)

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [January 10, 2025, 6:52pm UTC](https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443/5 "2025-01-10T18:52:17Z")

</div>

Closing the browser tab without ending the experiment will definitely lose the data.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [January 10, 2025, 6:54pm UTC](https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443/6 "2025-01-10T18:54:42Z")

</div>

Are you still using a 2020.2 version of PsychoPy?

---

<div class="post-metadata">

**Author:** ![gal](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/gal/32/43915_2.png) [@gal](https://discourse.psychopy.org/u/gal)\
**Post date:** [January 10, 2025, 6:56pm UTC](https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443/7 "2025-01-10T18:56:41Z")

</div>

yes - when i try other versions of psychojs, it won’t allow the experiment to run at all.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [January 10, 2025, 7:01pm UTC](https://discourse.psychopy.org/t/my-psychojs-code-wont-allow-data-to-save-in-pavlovia/43443/8 "2025-01-10T19:01:27Z")

</div>

If you are able to install more recent versions of PsychoPy I would strongly recommend that you seek help with getting your experiments working in a more recent version.
