| Reference | Downloads | Github

Keep getting unknown resource errors

URL of experiment:

Description of the problem:
Keep getting the unknown resources errors when sync the program.
unknown resources issue

All attempts to solve this issue:

  1. set HTML folder as path when sync online. This results in the js file and index file showing up in the folder and a resources folder created and stimuli.xlsx showing up there. Not working.
  2. sync and create js file (with the index.html) in the same folder as the .psyexp file. The stimuli.xlsx is in the same folder as the js file. Not working.
  3. Mannually create /html/resources folder and put the excel file under this folder. the js file (with index) is still with psyexp file. Not working.

In the stimuli import code component, the import path is relative path, only stimuli.xlsx.
Any idea what happened here?



no idea yet, but the link to your project leads to a Not found page

Best wishes Jens

Thanks for the help. Sorry i didn’t realize the access issue of the project. New updates below.

Just a follow up post. The solution is manually adding {'name': 'stimuli.xlsx', 'path': 'stimuli.xlsx'} to the resource dictionary in .js file where

  expName: expName,
  expInfo: expInfo,
  resources: [
    {'name': 'image/imagedemo2.png', 'path': 'image/imagedemo2.png'},
    {'name': 'instrucitonimage.xlsx', 'path': 'instrucitonimage.xlsx'},
    {'name': 'image/imagedemo4.png', 'path': 'image/imagedemo4.png'},
    {'name': 'image/imagedemo3.png', 'path': 'image/imagedemo3.png'},
    {'name': 'image/imagedemo1.png', 'path': 'image/imagedemo1.png'}

I didn’t output the files to an HTML folder, as suggested by the psychopy developer, see the post here PsychoPy Builder not creating HTML folder.

However I am still waiting for Becca’s reply regarding how exactly the .js file identifies the data source and loads it to the program. I am confused why the stimuli is not added to the resource. My stimuli.xlsx already present at the same folder as the .js file why the psychopy cannot add it to the resource dictionary automatically?

Thanks in advance.

This explanation may help.

1 Like

Thanks for the explanation. If this is the case, how I should explicitly declare the file path in a “user code” mode? It seems that I cannot access the psychoJS.start(resoures: {}) using the code component within the builder.

Hi There,

To clarify - was the stimuli.xlsx listed in the experiment settings > online tab in the resources list? that is what populated this part of the code. I recommend using that to add resources rather than manually editing code.

Depending what version of PsychoPy you are using, one reason a resource might not beginning resources are not automatically added when a resource is indexed from inside another resource (e.g. you have nested loops and the excel file that lists other excel files).


Hi Becca,

Thanks for your reply. I add the stimuli.xlsx to the additional resource place and this file shows up in the psychoJS.start(resources: {}) and it works.
I do have another question about “unknown resources” issue. I have another project that uses sound components. The path to sound files are saved in the excel files column “savepath” but the .js file cannot find the resource. (p.s. the excel file has been added to the resources and this runs successfully in local debug mode).


Here is the link to the project. The excel file named “sentence_processed.xlsx”

Hi there,

It looks like that resource isn’t in the list of loaded resources in the .js file

Looking at your .psyexp file I can this is because the file is not listed in the experiment settings > online > resources tab. Add all of the required resources in this additional resources space :slight_smile:

1 Like

Great thanks! It is fixed. So it seems that the path saved within the .xlsx files will not be reached by the server if the these files is imported through the code while such file-saved paths work for the cases where the .xlsx file is added through builder right?
For those using code component should also add the multi-media resources to the additional resources.

Just a summary after several posts and big thanks to @Becca. When handling the unknown resources error

  1. Add all required sources to the additional resources within the experiment settings → online tab. If only using the builder, the builder will automatically do this for you. However, when the stimuli file is imported through customized code components, this is needed because the .js file seems not to be able to handle the imported file through js variables such as var a = 'certain path' (here thanks to @wakecarter). What this step does as a form of js code is basically to inform where to find the resources in
  expName: expName,
  expInfo: expInfo,
  resources: [, 
# here is the place to add the stimuli, and other required files such as
{'name': 'image/imagedemo1.png', 'path': 'image/imagedemo1.png'},
{'name': 'stimuli.xlsx', 'path': 'stimuli.xlsx'}
  1. This is also needed when multi-media files, such as image, sound files are included in the experiment and the path is indicated or saved within the stimuli.xlsx file. Add those files to the additional resources.
  2. There is no need to export .js files to HTML when synthesizing the project online. Just leave the output path blank. The server will find resources in the folder where the .js file sits.
1 Like