psychopy.org | Reference | Downloads | Github

Help: TypeError: Cannot read property '0' of undefined

Hello I am receiving the following error when I run my study on Pavlovia ( TypeError: Cannot read property ‘0’ of undefined). The study runs well on PsychoPy.

On each trial, I present videos and I want my participants to type what they perceive. When I play it on Pavlovia I can only hear the words and not see the video and also I get the above error on the screen while the words are being played.

I have the same problem. I’ve seen other posts suggesting it’s a problem with var (for example see this post: https://discourse.psychopy.org/t/typeerror-cannot-read-property-0-of-undefined-in-pavlovia/15019) but I don’t understand how to fix this issue because editing code after it has been compiled doesn’t save the changes – I don’t have any custom code chunks where this fix seems applicable.

Hi there,

I can see that the “size” parameter in your “movie” variable is currently empty. When running offline in psychopy this will run as usual (since the actual height of the image will be used), however when running online each parameter field requires an input.

If you input the desired dimensions into the “size” field this should hopefully work :slight_smile:

Becca

3 Likes

I have also just discovered this same problem. However, I only got the size error when I attempted to run the experiment on Safari versus Chrome. Once I set the size, I additionally had to remove full screen as a default in the Psychopy general experiment settings. Now my videos work. Thanks all!

So pleased you managed to get things up and running! Please could you mark the corresponding answer as “solution” for future record?

Thanks,
Becca

Thank you so much! It works well.

Hi @Becca I have the same problem but I only run into it when I’m running the second block of a routine. Here is my url, could you possibly take a look? Pavlovia