Hi, this error message occurs only when I try to take an image from a list.
Under ‘begin experiemnet’: pic_list = [‘1.jpg’]
Under ‘begin routine’: pic = pic_list.pop()
In the image properties: $pic is ‘set to every repeat’.
This works fine locally, but when I upload the experiment to Pavlovia, I get:
2023.2.3.js:1200 | {“origin”:“ImageStim.setImage”,“context”:“when setting the image of ImageStim: image”,“error”:“the argument: 1.jpg is neither an image nor a video" }”}
When I use 1.jpg instead of $pic in image properties and set it to ‘constant’, the picture appears fine online so it’s not a problem with the picture.
I was able to figure out what went wrong and it seems to be related to python>js translation in the new version.
In the old version when I wrote in builder:
pic = pic_list.pop() it was translated to js as: pic = pic_list.pop();
However, in the new version 2023.2.3:
pic = pic_list.pop() is now translated to js as: pic = pic_list.splice((- 1), 1);
I changed it manually to pic = pic_list.pop() in the js window and now the experiment runs online.
I’m not sure why the python>js translation changed in the new version, but this was the problem.
I hadn’t noticed the change. It will probably be because.pop() is the same in Python and JS but .pop(0) only works in Python. I’ll create a minimal demo to test.