Pavlovia Error Code: Can't find variable: win

Description of the problem: I have been designing an experiment that runs smoothly on PsychoPy3. However, when I uploaded it to Pavlovia, this error code popped up:

Reference error: Can’t find variable: win

I know that is the variable for the window in python, but I am not sure how to troubleshoot that error. I do not have any custom code that includes that variable either.

Thank you for any suggestions!

1 Like

I would recommend that you upgrade to version 2020.1.3 if you are using a version 3.x (so you have auto translation of code components activated)

Have you seen my crib sheet where I recommend putting win=psychoJS.window; into code_JS?

Thank you for your response! I had not seen your crib sheet previously, but I added that code and it fixed this error, thank you!

Hi,
We are having same problem in pavlovia . Getting the same win error with video stimulus. Where did you exactly put this ’ win=psychoJS.window ’ code in the Java script? Because we couldn’t find the exact place to put it.
We are looking forward your answer :))
Thank you

Hello,
I added that line in a custom code component in my first routine. The crib sheet referred to in the previous response gives instructions for that and can be found here (PsychoPy Python to Javascript crib sheet)

The crib sheet also includes a lot of other good info about translating PsychoPy to Pavlovia, so I hope you find it useful!

1 Like

Thank you so much ! :slight_smile: