URL of experiment: Pavlovia
Description of the problem: I used the crib sheet to code the beginning of my experiment. I looked through my previous mistakes as well as another online study I got to work on Pavlovia earllier, however I cannot seem to find why this experiment is stuck at initialising. I would really appreciate any insights as to why this may happen.
Thank you!
What error do you get in the console?
Thanks for you quick reply, @wakecarter ! I get the following error:
ā159.2902 ERROR Line 2719: Unexpected end of input in KidSpatialMem.js.
Alert 4210:JavaScript Syntax Error in āBegin JS Routineā tab. See āLine 12: Unexpected end of inputā in the āBegin JS Routineā tab. For further info see 4210: Probable syntax error detected in your JavaScript code ā PsychoPy v2020.2ā
When I look at line 12, it isnāt anything I typed, there are import statements there however itās just the psychopy code. Line 2719 does not show up/exist. In my coder view it ends at 1110.
Specifically, the piece of code that starts at line 12 is:
āfrom subprocess import (
call,
Popen,
PIPE
)ā
Are you sure that thatās line 12 of your JS file. Mine look more like:
ļ»æ/******************************
* Change Detection Rsvp Test *
******************************/
import { PsychoJS } from './lib/core-2020.2.js';
import * as core from './lib/core-2020.2.js';
import { TrialHandler } from './lib/data-2020.2.js';
import { Scheduler } from './lib/util-2020.2.js';
import * as visual from './lib/visual-2020.2.js';
import * as sound from './lib/sound-2020.2.js';
import * as util from './lib/util-2020.2.js';
//some handy aliases as in the psychopy scripts;
const { abs, sin, cos, PI: pi, sqrt } = Math;
const { round } = util;
Sorry, I was looking at the coder view. I just opened the js file thatās on Pavlovia and mine looks similar to yours:
Iām still having a hard time seeing what is going wrong. I am not a good or efficient coder so I really wouldnāt be surprised if I am missing something obvious!
Is there a reason why you are still using version 2020.1?
No, I was working from the lab computer and not my personal one which is probably why it wasnāt updated. I just downloaded the latest version and synced, but I still seem to be having the same problem!
If the error is still mentioning 2020.1 then switch the experiment to inactive and then activate it again.
I switched the experiment, then downloaded it from Pavlovia since Pavlovia does not give me an error message, it just stays on āinitialising experimentā. I tried to run what I downloaded locally and got the error:
āAlert 4210:JavaScript Syntax Error in āBegin JS Routineā tab. See āLine 12: Unexpected end of inputā in the āBegin JS Routineā tab.
For further info see 4210: Probable syntax error detected in your JavaScript code ā PsychoPy v2021.2
Alert 4210:JavaScript Syntax Error in āBegin JS Routineā tab. See āLine 12: Unexpected end of inputā in the āBegin JS Routineā tab.
For further info see 4210: Probable syntax error detected in your JavaScript code ā PsychoPy v2021.2ā
When I open the js file, this is what is on line 12:
What you need to do in this situation is look in the Developer Console (Ctl-Shift-I) for the error message. I think the error message you are reporting is caused by testing a remote js file locally.
1 Like
Thank you very much for telling me where to look, I was having a hard time making sense of the error! Now that Iāve done that, I get a 404 error (Failed to load resource) as well as āunexpected end of inputā (uncaught syntax error.) I believe the syntax error message is mentioning line 2709, I donāt have that line on my js file, but I have the end very close to it. I included the screenshots.
I took a look at the crib sheet, for endings since it mentions end of input at the end of the experiment. My final event is just a āthank youā text that has 5 seconds duration.
Is there anything I needed to add to the end to make this work? Now Iām questioning everything I did!
This error implies an unbalanced bracket or similar.
I would recommend that you check that none of your auto translated code components have syntax error displayed, then check Both and JS code components very carefully (possibly via recreating Both components from their Auto versions), then check any other components that have none trivial code in them.