Stuck at initialising although I used the crib sheet

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:Screen Shot 2021-01-27 at 19.00.45

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.
Screen Shot 2021-02-03 at 14.12.47 Screen Shot 2021-02-03 at 14.13.02

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.