| Reference | Downloads | Github

Problem with online experiment - black screen - does not show conditions

URL of experiment:

Description of the problem:
I tried to start the experiment, but the screen remains black.
In my local machine it works, both by running it from psychopy and launching it from python3.
When I load it onto pavlovia it starts, it makes me enter the data but when it has to show me the stimuli, they are an array of white squares, the screen remains black.
Has anyone had the same problem?
I am grateful for the help.

I’m afraid there isn’t enough detail here to understand what’s going wrong. Please link your Pavlovia repository (go to the experiment page and click “view code”) and make sure that the repository is public (go to settings -> general -> permissions).

I would also recommend looking at your web browser’s JavaScript console to see if it’s producing any error messages when you try to run the experiment. In Chrome this can be found under view -> developer.

Thanks for the reply Jonathan.
The browser shows no javascript errors.
I attach the link to the code as you asked.

The repository is not public. go to “view code”, then “settings -> general -> permissions”

see if you can get in now

OK, made myself a copy of your experiment. I’ve found a few issues.

The blank is probably because the “begin routine” tab of the code component in your “training_learning” trial was not translated to JS, even though auto->JS was selected as the code type. reselect it as the code type and it should at least do that.

However, this will yield further errors. Specifically, “append” does not exist in JS, you will need to use “push” instead. So after changing the code type to auto->JS, change it to “both” and change “append” to “push”. Ditto for something in “Every frame”.

Then you run into a bunch of things being undefined, which seems to be correct. I’m not sure when “curBlock” is actually defined in this code, but at the very least, going into the JS console at that point will get you more informative errors and tell you which specific line is causing the issues.

Thanks, I’ll try and let you know

Ok Jonathan, many thanks.
I have make the cange and now error is
at the line 1782 (currBlock.color = “white”; )
At least it’s not a black page


Yeah, this is about as far as I got in the time I had. Basically, it’s saying that “currBlock” is never defined. Looking at the code, I’m not entirely sure what you’re trying to define currBlock as. Can you tell me a little about what that line of code is supposed to be doing?

I understand the problem and am trying to solve it. It is not currBlock itself but the object assigned to it which is not defined. I’m trying to correct the problem. I hope there aren’t others.

HI Jonathan,
I corrected the errors of definition of the objects that gave me the debug. I also checked the values of the variables and now they are filled. But now I have a “black page” again… :thinking:

Hello, I still have the problem.
the experiment is called “visual_match_NEW_Forum.psyexp”.
the debug console does not show any js errors but the stimuli are not seen.
Squares should appear which activate in a sequence defined in the xls file but this does not happen.
In the debug console only the message
visual-2020.1.js:493 50 >>>>>>>>> CREATING PIXI POLYGON!!!

Can anyone help me?
Thank you so much!!

Are you still defining colours in quotes?

Are you displaying objects using .setAutoDraw(True) in the order you need them?

Do you have a combination of elements that are builder components and code objects?

Best wishes,


I create all the objects and set the background color.
From the xls file I see those to be activated and set the color to white.
So yes.

example: blk1_t = new visual.Rect

Thank you

Good morning. Maybe I found the problem. I defined the rectangular unit in “deg”. It is necessary to define differently. What do you recommend?

I would recommend Height. You can only use Height, Norm and Pixels online

I have to get what you see in the photo. I was wondering if there was a way to convert deg to height

“deg” is based on viewing distance and physical monitor size, which you can’t get over Pavlovia, but if you’re using them, it’s based on whatever you’ve set up in your monitor settings on your local computer. As a result there is no direct conversion between deg and height, because height is only based on the pixel dimensions of the window (typically just the screen resolution).

Your best bet is probably going to be to convert to “height” when running locally and do a bit of trial and error until it looks right on your own computer, at which point it should take up the same amount of screen on anyone else’s (but of course screens can be different sizes and they can be sitting at different distances). You can read up on how height is defined here:

EDIT: You can, however, convert directly to pixel dimensions using tools.monitorunittools.deg2pix on your own computer, but there’s still no way to go directly from pixels to height. However, you may be able to use the pixel dimensions and your own screen resolution to work out the conversion.

OK thanks!

I managed to reposition all the squares and now I finally see them. I have corrected all the code according to what you have indicated but still something is wrong. Now, according to the indications written in an excell file, four squares should turn white, one at a time but this does not happen. I checked the color codes but I don’t know what else it could be. I created a new repository with a test experiment and I reduced the code to a minimum. What else can I check?