psychopy.org | Reference | Downloads | Github

"unknown resource" file error when testing locally

URL of experiment: https://pavlovia.org/jacobtfisher/irene-thesis-2

Description of the problem: I’m working on porting an experiment to Pavlovia and I’m getting the “unknown resource error” for my conditions file that it seems many others have been getting as well, but I’ve tried all of the solutions I’ve seen to others’ issues to no avail.

The experiment is a simple text-based experiment with no images or other files referred to in the conditions file. Interestingly, when I run the experiment on Pavlovia itself I am not getting the error–only in the local debug mode. I’ve tried moving the conditions file into the base html folder created by PsychoPy, and have tried a minimal version of the conditions file only containing one line. I’ve also triple checked the CSV for any formatting errors. I’m not sure what is causing the debug mode to fail.

Any thoughts?

1 Like

Hi Jacob,

I’ve had the same issue. As far as I understand the library (I’m not fluent in javascript), upon running the experiment locally a “ServerManager” instance will be created that is responsible for downloading resources and saving them in a private “_resource” variable. For some reason, this doesn’t happen for some resources like a local conditions file when you run in local debug mode. As a workaround that works for me, you may pass resources like image stimuli and conditions files to the PsychoJS instance at the beginning of the experiment when the start() method is called.

psychoJS.start({
expName: expName,
expInfo: expInfo,
resources: [{name: ‘Trials.csv’, path: ‘./resources/trialTypes.csv’}]
});

So I had to add the part beginning with “resources: …”.

Hope that helped.

Cheers,
Alex

1 Like

Hi all,

I find myself in the same situation. I’m able to run the experiment on Pavlovia, but not in the local debug mode. I am loading conditions from an xlsx file (ConditionsMat.xlsx) placed in my resources folder… but the debugger fails loading this file:

Unfortunately we encountered the following error:

  • when importing condition: ConditionsMat.xlsx
  • when getting the value of resource: ConditionsMat.xlsx
  • unknown resource

I tried the workaround suggested above, but no avail:

psychoJS.start({
expName: expName,
expInfo: expInfo,
resources: [{name: ‘ConditionsMat.xlsx’, path: ‘./resources/ConditionsMat.xlsx’}]
});

Does anyone have a suggestion on how to sort this out? This would really make debugging so much faster!

Thank you!!
Nicola

1 Like

Same issue here, resources specified in custom (py+JS) code remain unknown. (PsychoPy 2020.1.3) Online they seem to work.

But how do you add the resources line in Builder? It doesn’t expose things like calling the start() method, right? I’d kinda hate to go tweaking the .js file after it’s been created, especially since that means tweaking it after every sync.

Yes, you have to adjust the source code manually. I actually stopped trying to get experiments run via pavlovia. I’m using PsychoPy Builder only for getting the experimental structure right and then I simply do the rest manually. I also managed to get everything run on my own server, although Javascript is a real hassle.

Are you sure that path and filename are correct?

Hi!

turns out I misspelled the file name! I thought I triple-checked … but I should have known better.
I can confirm that it loads the file properly!!

Thanks!