Hi.
I’ve taken a look and I’m pretty sure that the issue is that you are writing JavaScript code that isn’t compatible with PsychoJS. You have disabled your text components and replaced them with JS only code components. You implied that previous versions of the experiment worked fine. On what date did this experiment last run and what did you add next?
Begin Routine
let introDiv = document.getElementById("introTextDiv");
introDiv.innerHTML = introText;
introDiv.style.display = "block";
End Routine
// Hide intro text at end of trial
let introDiv = document.getElementById("introTextDiv");
if (introDiv) {
introDiv.style.display = "none";
}
Here are some threads with the same issue:
URL of experiment: AudFlankTest_legacy [PsychoPy]
Description of the problem:
Hello all! I seem to keep receiving ReferenceErrors when attempting to run this experiment online. The variables never seem to be declared in the auto-generated JS file, which I seem to recall has been the case previously. For example, in the below snippet, currentLoop is never defined anywhere using var/let/etc.
async function updateInfo() {
currentLoop = psychoJS.experiment; // right now there are no loops
..…
URL of experiment: https://run.pavlovia.org/learningdevlab/3b_complex_binctl/html
Description of the problem: When I click to pilot my experiment, I get through the dialog box, but then immediately get a frameDur error
when I check the javascript console, my error is related to code that was generated automatically by psychopy/pavlovia
[Screen Shot 2020-03-11 at 12.21.56 PM]
// store frame rate of monitor if we can measure it successfully
expInfo['frameRate'] = psychoJS.window.getActualFr…
and relevant tips
Builder isn’t Coder
I strongly discourage the use of PsychoPy Coder for the creation of psychology experiments because Builder is easier to debug, share with others and translate into PsychoJS for use online.
If you already have an experiment written in Coder, pasting the code into Builder code components is not sufficient to turn it into a Builder experiment. The logic of how to arrange an experiment is slightly different because of the way Builder works with components, routines and loops.
F…
Use Auto → JS code components wherever possible
Even if you aren’t planning to run your experiment online, using an Auto code component will help you spot syntax errors in your Python code.
[image]
There are some cases where valid Python code comes up as a Syntax error on the JavaScript side but these are rare and, when you encounter then, you can switch to a Both code component and edit or delete the JavaScript side to highlight the fact that they contain code that won’t run online unedited. …
Own up to AI
When trying to help people on the forum or through consultancy we are experiencing an increase in the amount of idiosyncratic or opaque code, coming from novice programmers who. ChatGPT and other AI tools can be a great help with programming tasks but they are not experienced with the architecture of PsychoPy Builder. If you use them, please add a comment to your code along the lines of # Created using ChatGPT to create random pseudo-words. Adding your main prompts as comments might…