Unspecified Javascript Error: FATAL unknown

Dear all,

Apologies for the many posts. I have tried a lot of different things to get my experiment to work online. Nothing seems to work. I have compared my code with similar experiment that also involve pictures, but I cannot seem to find what I am doing differently for my experiment not to work.

I would be very grateful if somebody would be able to help me with this.

URL: Communication Experiment Test 3 [PsychoPy]

Kindest regards,

Snoek

error4

I get jars3 is not defined.

ReferenceError: jars3 is not defined
    at Scheduler.experimentInit [as _currentTask] (Communication Experiment Test 3.js:710)
    at Scheduler._runNextTasks (util-2020.1.js:1091)
    at Scheduler._runNextTasks (util-2020.1.js:1094)
    at update (util-2020.1.js:1058)

with the offending line in the middle of

EmptyJar = new visual.ImageStim({
    win : psychoJS.window,
    name : 'EmptyJar', units : undefined, 
    image : (jars3 / jar0.jpg), mask : undefined,
    ori : 0, pos : [(- 0.35), 0], size : [0.3, 0.45],
    color : new util.Color([1, 1, 1]), opacity : 1,
    flipHoriz : false, flipVert : false,
    texRes : 128, interpolate : true, depth : 0.0 
  });

Is that a component created in Begin Experiment code or Begin Routine?
Does jar0.jpg exist in html/resources ?

It does exist in the html/resources folder under the map: ‘jars3’. I just tried to start a completely new experiment with only a picture and a text element, and the same error comes up that jars3 is still not defined. All the images have the right names as well and all images are present.

This is what it looks like in the resources folder (which is in the html folder):
image3

I have some working code which suggests that you might need quotes.

bars.push(new visual.ImageStim({"win": win, "name": "ladder", "image": "ladder.png", "ori": 0, "pos": [0, (((Idx - 4) * scale) + voffset)], "size": [((scale * dtarget) * 28.72), (scale * dtarget)], "color": white, "colorSpace": "rgb", "opacity": 1, "flipHoriz": false, "flipVert": false, "texRes": 128, "interpolate": true}));

I have found it is definitely a problem in the retrieval of the images and not the loading in of the images as this seems to work fine.

Where would I implement these quotes?

I load in pictures in both code components of PsychoPy Builder manually by name (1) and by inserting directories in image components (2)

picture = ["jars3/jar150.jpg", "jars3/jar175.jpg", "jars3/jar200.jpg", "jars3/jar225.jpg", "jars3/jar250.jpg", "jars3/jar275.jpg", "jars3/jar300.jpg", "jars3/jar325.jpg", "jars3/jar350.jpg", "jars3/jar375.jpg", "jars3/jar400.jpg", "jars3/jar425.jpg", "jars3/jar450.jpg", "jars3/jar475.jpg", "jars3/jar500.jpg", "jars3/jar525.jpg", "jars3/jar550.jpg", "jars3/jar575.jpg", "jars3/jar600.jpg", "jars3/jar650.jpg", "jars3/jar675.jpg", "jars3/jar700.jpg", "jars3/jar725.jpg", "jars3/jar750.jpg", "jars3/jar775.jpg", "jars3/jar800.jpg", "jars3/jar825.jpg", "jars3/jar850.jpg"]

image4

If you are adding file names to image components then you should either lose the $ or the filename, i.e. jars3/jar500.jpg or $picture[14]

The quotes were for code components.

Sadly, I get the same errors with and without the “$”.

I did initially insert it without the “$”, but I tried it with as I thought it may help somehow.

It looks like your folder is actually called Jars3 not jars3 online. That screen shot was from your local computer, wasn’t it?

It was, yes, I tried changing the name of the folder to have no capital letters thinking it would change in Pavlovia too. I thought that perhaps the capital letters had something to do with the error.

I have now changed the code so that it is accessing “Jars3/jar0.jpg”, however it is still giving similar errors.

EDIT : I just tried to replace all “jars3/jar500.jpg” calls in the image components by $picture[14] types. However, this did not change anything.

Apologies for the many questions @wakecarter, but do you perhaps have any idea what these errors could be caused by?

error5

Please could you give me developer access to your experiment so I can take a closer look?