psychopy.org | Reference | Downloads | Github

Online experiment "Unknown Resource" issue

Good shout. Francesca, did you try the resources folder? If not, could you try deleting the experiment on Pavlovia and re-uploading? See e.g. Create new experiment from existing file

Hi all,
I managed to solve the problem by uploading resources trough the prompt. For some reason, the sync options doesn’t work properly with me. But more in general I have issues with pychopy when it has to refer to .csv or -xlsx condition files.

I have the same problame and I tried to change the names. Could you pls help me?

this is the massage I get:

image

the name of my experiment is HIS1

I can’t find your paradigm on pavlovia, but i think your resource files aren’t loaded correctly at the beginning. (I also had this problem)
Deactivate your project, empty your browser cache (just to be safe) and activate it again. If this isn’t the solution you can delete your whole project online and upload it again with a different name.

Can you also share a screenshot of the welcome screen, where the resources are loaded?

Hi,
thank you for your fast replay.
it works now

cheers :slight_smile:

I am experiencing the exact same problem.
I have a bunch of png files that need to be displayed and I always get the error message

I tried everything. Adding the png extension to the path column in my excel file, getting rid of all spaces in the paths, all files are in both the html and the resources folder, because I don’t know where the heck they need to be, so better be safe than sorry. Is it the complete path that is only available on my computer? Somebody please help, I am working on my bachelor thesis and I am wasting so much time by not getting this done!

Thanks in advance <3

I’m experiencing the same problem.

It works fine localy, but not online.
I’ve tried everything, and it is driving me crazy.

link to the experiment: Sign in · GitLab

Many thanks!

Sorry you haven’t had a reply to this before. You seem to be trying to load the png files from your Desktop, which won’t work online. Check the path in your image components.

Hi,

I’m not sure, but you seem to have the JS files uploaded in three locations (root, html and html/resources) so it’s possible that you are running the experiment from the wrong one. I had some difficulties with this and found that having broken something with an experiment I needed to run it from the root, not the html sub directory.

Also, do try a hard refresh with Ctrl-Shift-R

Thanks very much for answering my post, @wakecarter! I’ll try to keep the files in only one folder. I’ll update this topic when I finished to do that. Thanks again!

I seem to be experiencing the same thing. The funny thing is the exercise loop doesn’t seem to have any problems. The trial conditions files are assigned by a code snippet, which I have checked multiple times for any errors.
image
This is the experiment:

Dear David (and Wakefield mentioned in the following message),

Sorry for ‘pinging’ this old message… I’m kind of a newbie with Pavlovia… I have a problem that I think is related to the issue of not having a html folder in my project. I tried making a second project with the same experiment but still no html folder. My issue is that I use images called within code components in this experiment, and I think they are not loaded in the online experiment (I get ReferenceError). As @wakecarter mentioned in his crib sheet, this expectedly result in a failure to find the images. Manually moving the images to the ‘html/resources’ local folder should do the trick (I hope), but since I do not have this folder in the gitlab project (https://gitlab.pavlovia.org/JeanM/igt-test) or in my local folder on my computer, I do not know what to do. Out of desperation, I even tried to manually create a ‘html’ folder, but it did not result in a success.
The experiment is an IGT and works fine locally.

I’d be really thankful if you were to have any insight regarding my situation. Do not hesitate to ask if you need more information.
Best,

Jean

P.S.: Best wishes for the new year!

Okay, I found how to create the html folder. I just had to write ‘html’ as the output path in the ‘online’ tab of the general settings in the builder.

I still get a “ReferenceError: StimList not defined” error… maybe it has something to do with how I defined the list in my task. It works fine locally but not online, so maybe it has something to do with the JS code (I use shuffle() and create arrays of arrays because each list is made of different elements of different lists…). So I’ll go back to understand how JS works, because I suspect the error stem from my lack of skills in JS.
At least now, the images are loaded in the online experiment.

Cheers,
Jean

Hi Jean,

PsychoPy doesn’t create (or need) the html folder any more to reduce the duplication of resources on the Pavlovia server. Resources are selected by adding them in the online tab.

Best wishes

Wakefield

3 Likes

Thanks, wakecarter this solved issues I was losing my mind over.

For anyone reading:
> On builder view click the cog wheel to edit experiment settings.
> Go to the online tab then select all of the resources you wish to use.
> If in the resources folder, ensure you reference them with the preface " resources/ ".

2 Likes

Hi,

I encounter a similar problem and please check for detail here. The code link is here. Could you help with that?

Thanks in advance

Hi Wakefield or anyone else who has ideas on how to solve this,

I’m wondering what exactly you mean by PsychoPy doesn’t create or need the html folder any more? I have been trying to solve the same issue as everyone else here and it doesn’t matter where I put my stimulus file (a list of words that are displayed on screen) and how I reference it in the experiment, the error message remains the same.

So far, I have tried all combinations of the following that made any sense to me:

  • Moving the stimulus file to: a) the same place as the .py file, b) a resources folder in the main folder, c) into the html folder itself, d) into a resources folder in the html folder and e) psychopy also created a html/resources/resources structure and put the stimulus file in there at some point.
  • Calling the stimulus file with all possible paths in the trial loop. Everything that should logically work did so offline but failed to do so online.
  • Including all possible pathways in the online tab. (I noticed, that I can’t manually change the paths displayed here.)
  • Removed the html from the online tab and tried running the experiment both with the html folder structure intact and with the .js files in the main folder. → The latter creates a different error message on Pavlovia, where the experiment can’t be loaded at all.

Any other ideas or combinations that should work?

Cheers,
Annika

In 2020.1 PsychoPy created an html folder for index.html and the javascript files. It also copied resources to html/resources and loaded everything in that folder into memory at the start of the experiment. If you needed a resource that was only mentioned in code you could just copy it to html/resources to tell PsychoPy to load it.

This was inefficient because it meant that most experiments had two copies of its image, sound and video files which could nearly double the disk space used.

From 2020.2 the default became creating index.html and the JS files in the experiment’s root folder, alongside the psyexp file. If you needed a resource that was only mentioned in code you now have to add it via Experiment Settings / Online to tell PsychoPy to load it.

From 2021.1 PsychoPy can get confused by experiments still using the html folder and also needed to add resources via Experiment Settings / Online. If it works, don’t worry about it, but if it doesn’t then I would recommend recreating the experiment in a new local folder and syncing it to a new online experiment, having first ensured that the output path in Experiment Settings / Online is blank.

1 Like

For anyone experiencing resource issues using an html folder…

I have just been down the rabbit hole with this resources issue using a previous study as a template. I used to use the ‘html’ online folder but for the life of me couldn’t get anything to download resources wise, which caused the unknown resource error.

By deleting the project and rejigging it without the html folder (i.e. everything in the root, where the .psyexp is) AND adding the (image) resources under the Online tab seemed to solve this for me. I honestly thought I was going mad, I have made loads of Pavloiva experiments in the past using the html prefix. I guess I’m just catching up to the new ways.

2 Likes