psychopy.org | Reference | Downloads | Github

Unknown error - can't find image file - polyfill

URL of experiment:

Description of the problem: I designed my experiment in builder and it ran great locally. When converting it to javascript and trying to run it online - I couldn’t get the online version of the program to run the experiment online. Every time, I received an “unknown error” cannot find my first image file. For some reason, the program didn’t know to upload the images.

What I tried to do:

  1. make sure there were no backslashes in the file locations
  2. make sure html file contains the image files
  3. manually add the image files
  4. resynch

The only thing that worked was this link…

This required me to run my experiment in a previous version of psychopy (2021.1.4).

This worked once and the experiment downloaded the images.

However, the experiment failed to find one of the files, so I tried to add it manually and resynch - now every time I try to load the experiment and run it, it doesn’t move past the initialization screen.

So, I deleted the polyfill code and refollowed the steps to use the program.

I got it to work but it is now asking to download 700+ files and is giving me this error when trying to get into the program

“ReferenceError: PsychoPolyFill is not defined”

Can someone please help me! I don’t know enough about javascript to go through the code and figure out what is wrong. This is a complete mess and I have been trying to get this to work for 2 days.

Polyfill appears in both Before Experiment and Begin Experiment of code_JS

However it may not be needed in 2021.2.3

Do you have 700 resources that need to be made available to the experiment?

How man

No, I need to clean something up regarding my resources, but I was having this issue well before the 700+ resource issue.

I can’t seem to get pavlovia (which i an awesome name by the way!) to start download things online - unless I add the Polyfill. Could someone help out with why this might be happening. I am assuming it is some issue with the code translating into Javascript? I’ve tried to look for obvious issues but can’t seem to find the problem.

Here is my error log when I removed pollyfill and ran the program in the most recent version of psychopy. It doesn’t look like I can attach it here.

pdate @ Scheduler.js:147
Window.js:86 windowAlreadyInFullScreen: true
PsychoJS.js:726 {origin: “ImageStim.setImage”, context: “when setting the image of ImageStim: image_2”, error: {…}}
window.onunhandledrejection @ PsychoJS.js:726
log4javascript.js:148 FATAL 10:52:42.238 GUI.dialog psychojs-2021.2.3.js:1257 | {“origin”:“ImageStim.setImage”,“context”:“when setting the image of ImageStim: image_2”,“error”:{“origin”:“ServerManager.getResource”,“context”:“when getting the value of resource: Images/oasis/Acorns1.jpg”,“error”:“unknown resource”}}
BrowserConsoleAppender.append @ log4javascript.js:148
Appender.doAppend @ log4javascript.js:81
Logger.callAppenders @ log4javascript.js:64
Logger.log @ log4javascript.js:64
fatal @ log4javascript.js:68
dialog @ GUI.js:342
window.onunhandledrejection @ PsychoJS.js:737
Scheduler.js:164 Uncaught (in promise) {origin: “ImageStim.setImage”, context: “when setting the image of ImageStim: image_2”, error: {…}}
update @ Scheduler.js:164

The download portion doesn’t go and then it says it can’t find the file. The file appears to be there both in it’s original location and in html/resource folder.