# ReferenceError: thisExp is not defined and other missed characteristics

**URL:** <https://discourse.psychopy.org/t/referenceerror-thisexp-is-not-defined-and-other-missed-characteristics/16357>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [September 9, 2020, 9:45am UTC](https://discourse.psychopy.org/t/referenceerror-thisexp-is-not-defined-and-other-missed-characteristics/16357 "2020-09-09T09:45:27Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![irune\_fernandez](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/irune_fernandez/32/9406_2.png) [@irune\_fernandez](https://discourse.psychopy.org/u/irune_fernandez)\
**Post date:** [September 9, 2020, 9:45am UTC](https://discourse.psychopy.org/t/referenceerror-thisexp-is-not-defined-and-other-missed-characteristics/16357/1 "2020-09-09T09:45:28Z")

</div>

URL of experiment: [https://pavlovia.org/run/IruneFernandez/foodiat-2020/html/](https://pavlovia.org/run/IruneFernandez/foodiat-2020/html/)

Description of the problem:  
Hi everybody,

I’m a beginner with Psychopy and Pavlovia. I’m having some troubles. My experiment is a modification of OpenIAT ([https://gitlab.pavlovia.org/demos/openiat](https://gitlab.pavlovia.org/demos/openiat)). Locally is working ok, but when I try in Pavlovia this happens:

Unfortunately we encountered the following error:

- **ReferenceError: thisExp is not defined**

Try to run the experiment again. If the error persists, contact the experiment designer.

I have checked the JavaScript code and it seems to be defined (I’m a beginner)

Also, the instructions are not “centred” as the local version and my “plate stimulus” is disappeared, (I’m using two images overlapped).

I’ve tried the exp in the version of PsychoPy v2020 1.3 and now in 2.4 (always Windows and Firefox)

Url: [https://pavlovia.org/run/IruneFernandez/foodiat-2020/html/](https://pavlovia.org/run/IruneFernandez/foodiat-2020/html/)

> **[Irune Fernandez / FoodIAT 2020](https://gitlab.pavlovia.org/IruneFernandez/foodiat-2020)**
>
> Modification from openIAT

Thank you for your help!

---

<div class="post-metadata">

**Author:** ![D3njo](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/d3njo/32/5605_2.png) [@D3njo](https://discourse.psychopy.org/u/D3njo)\
**Post date:** [September 9, 2020, 10:43am UTC](https://discourse.psychopy.org/t/referenceerror-thisexp-is-not-defined-and-other-missed-characteristics/16357/2 "2020-09-09T10:43:50Z")

</div>

Hi!

You have to change the JS-code from thisExp.addData to **psychoJS.experiment.addData** in your code snippets.

---

<div class="post-metadata">

**Author:** ![irune\_fernandez](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/irune_fernandez/32/9406_2.png) [@irune\_fernandez](https://discourse.psychopy.org/u/irune_fernandez)\
**Post date:** [September 9, 2020, 3:56pm UTC](https://discourse.psychopy.org/t/referenceerror-thisexp-is-not-defined-and-other-missed-characteristics/16357/3 "2020-09-09T15:56:55Z")

</div>

Hi D3njo,

Thank you for your reply. I did as you said but I have the same error.

---

<div class="post-metadata">

**Author:** ![irune\_fernandez](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/irune_fernandez/32/9406_2.png) [@irune\_fernandez](https://discourse.psychopy.org/u/irune_fernandez)\
**Post date:** [September 10, 2020, 12:44pm UTC](https://discourse.psychopy.org/t/referenceerror-thisexp-is-not-defined-and-other-missed-characteristics/16357/4 "2020-09-10T12:44:46Z")

</div>

Ok, it seems that it worked, BUT…  
now I have another problem:

Unfortunately we encountered the following error:

- TypeError: this is undefined

Try to run the experiment again. If the error persists, contact the experiment designer.

It happens after the third slide of instructions when it should stard the experiment.

At least now (I don’t know way, but it changed) the instructions are presented as they were in the local version.
