Pavlovia thisExp is not defined

URL of experiment:

Description of the problem:
I tried to make my Experiment work with Pavlovia. Besides a lot of other problems i always get the error thisExp is not defined even though “thisExp=psychoJS.experiment;” is defined at the Beginning of the Experiment.

I’m very grateful for any help!

Please check your code components. One of them says /* Syntax Error: Fix Python code */ on the right hand side.

Please show a screenshot.

I am having a lot of Problems with the code components. Since I’ve updated PsychoPy to the latest Version i can’t no longer open the coder view.

However thisExp = psychoJS.experiment; is one of the components who is translated fine but still causes trouble

What you are showing here is JS code being added to the Python side of an auto code component. It needs to be switched to a JS component and then added (it it appears on the right hand side).

Not being able to open code components usually means that the code comes from a future version. I’ve mostly seen it when someone tries to open a 2020 experiment in version 3.

Thanks for the advice I changed it. Yet still the described error occurs when I try to run it online

I just opened your experiment in 2020.1.3 and the code components seem to have Python code in JS components. I also spotted a $ at the beginning of a variable name in one component. I couldn’t find where you were using thisExp.

Adding the $ was one desperate try to define my variables. But even if I remove that it has no influence on the current error.

I even removed the code component were I wanted to add data (were I used thisExp.addData or psychoJS.experiment.addData) and it doesn’t helped. I have no idea where or why pavlovia wants thisExp to be defined.

Two things to try:

  1. Add text in the first screen with the upload date to confirm that you are testing the latest version.

  2. Search the JavaScript code (Ctl-F) on Gitlab for “thisExp” to see if it appears more than once.

That is a very good point! The gitlab files are updated correctly and I can see the changes I made in the .py and .js files but they are not updated in my pilot study.
It is updated now (even though i didn’t changed anything intentionally) and i’ve got rid of the error

Thank you so much for your time and help