Keep getting unknown resource errors

I’m posting this for the benefit of other relative newbies like me who might be googling madly for a solution using a more recent version of PsychoPy. I’m a rank beginner with online experiments and so some of my suggestions might be a bit “magical”. But after repeatedly encountering an “unknown resource error” using PsychoPy version 2021.2.2 (Mac Catalina 10.15.7) – even after following the instructions here to ensure resources were listed under the experiment settings online tab – I finally found other online resources to lead me to a solution that I hope others might also find helpful. None of this is my own work – it is helpful advice provided by others in up-to-date resources that I hadn’t known existed!

  1. Download the most recent version of PsychoPy if that is not what you are already working with

  2. Go to: PsychoPy Python to Javascript crib sheet 2021 - Google Docs

This is the latest ‘crib sheet’ compatible with most recent PsychoPy versions, authored by Wakefield Morys-Carter (thank you!!!)

  1. Within that document, you’ll see instructions to follow this link: Thomas Pronk / demo_polyfill · GitLab

  2. From here, download the most recent version of PsychoPolyfill.js to the same folder where you have your PsychyoPy script

  3. Then

Add a code component called code_JS in your experiment’s first routine.
Switch it from Auto->JS to JS

  1. From within code_JS > * BEFORE * Experiment tab paste exactly this, including the final semicolon:

import PsychoPolyFill from ‘./PsychoPolyfill.js’;

  1. From within code_JS > * BEGIN * Experiment tab paste exactly this, including the final semicolon:

PsychoPolyFill(expInfo.psychopyVersion, psychoJS, util);

  1. Make a note of the latest version of PsychoPy with which the PsychoPyPolyfill is compatible (currently 2021.1.4)

  2. In PsychoPy Experiment Settings (the gear icon) > Basic > set “use PsychoPy version” to match the latest supported version (e.g., 2021.1.4)

  3. In PsychoPy Experiment Settings (the gear icon) > Online make sure you add all resources that are needed by your experiment (e.g., .xlsx, .csv etc), ensuring that the path you use matches the path you use in your Designer call

  4. In PsychoPy Experiment Settings (the gear icon) > Online set the output path to html

  5. File > Export HTML

  6. From within PsychoPy: Pavlovia > [New or Sync]

14. Just to be sure the sync works, you can also select the blue globe icon with the “P” from the top of the PsychoPy window and select your Pavlovia experiment name, ensure that the local is correct, then sync (this is also probably a bit of magical thinking but I find this more reliable than the step outlined in “13”, above)

Following these steps eliminated a persistent “unknown resource error” as well as an occasional error of getting stuck on experiment initialization due to failure to find a tone file.

3 Likes