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.