Index file for online experiment references missing 'Lib' folder containing JavaScript modules

URL of experiment: Sign in · GitLab

Description of the problem: Hello all,

I will preface this by saying that the experiment in question was originally written in Python using PsychoPy builder and subsequently converted to JavaScript in order to run it online. This experiment runs as it should in Pavlovia (pilots as it should, at least) and has not given me any trouble until I started trying to get it to run on a private server.

I’ve been trying to get an online experiment up and running on a private server connected to my institution and have been running into a problem. The experiment will not start (there is just a blank screen), and the developer console displays this error:

This appears to reflect the fact that the experiment’s ‘index.html’ file references a ‘Lib’ folder that does not exist in the directory created by PsychoPy when saving the experiment. The folder is referenced only once, as far as I can tell, in line 5 of ‘index.html’:

import { core, data, sound, util, visual } from './lib/psychojs-2021.2.3.js';

The issue here is that I cannot find this file (or exact folder) in PsychoPy’s program files, or anywhere else. I can find JavaScript files corresponding to all the relevant exports from that line (i.e., core.js, data.js, etc.) but there is no trace of ‘psychojs-2021.2.3.js’. So, how might I go about solving this? Can I download the ‘Lib’ folder in question? Presumably it exists somewhere as the experiment functions as it is supposed to on Pavlovia. If not, would there be a way to rewrite this line of code to use the core.js (and so on) files, which I could put in a directory within the experiment, rather than the file being referenced?

I apologize if any of these are silly questions - I have limited knowledge about coding with JavaScript, but I could not find anything like this elsewhere on the forums. I’ve made the Gitlab repository available internally, so everyone should be able to view it when signed in. If anyone has any suggestions about what to do here, I would really appreciate it!

Thank you

If you need to run PsychoJS on your own server you will need to contact Open Science Tools to discuss local installation.

Thanks for the reply!

Turns out all I needed to get the experiment working was to run it in local debug mode again - this generated the Lib folder with the appropriate resources and it works fine now!

1 Like