Blank screen in Pavlovia after forking and cloning JsPsych experiment

jsPsych version (e.g. 7.3.1): 7.3

Hi,

I’m new to using Pavlovia so apologies in advance if this is a very basic question.

I have forked, cloned and updated JsPsych experiment from GitHub as per instructions here.

When I try and run this experiment in pilot mode all I get is a blank screen. The initial line of the .html file is being read as the title of the page matches that defined in the header. However nothing else happens.

The project lives here: Lexi Hayes / impulsivity_metacognition · GitLab

Thank you in advance!!

Lexi

Are you failing to close your <script> clauses?

    		/* init connection with pavlovia.org */
    		var pavlovia_init = {
    			type: "pavlovia",
    			command: "init"
    		};
    		timeline.push(pavlovia_init);

		<div id='jspsych-target' style='width:800; height:auto; position:relative;'></div>
		<canvas class = "canvas" id="myCanvas"></canvas>
		<canvas class = "stimulusCanvas" id="myInnerCanvas"></canvas>
		<canvas class = "stimulusCanvas" id="myInnerCanvas2"></canvas>
		<canvas class = "canvas" id="myBlankstimCanvas"></canvas>
		<canvas class = "canvas" id="myFeedbackCanvas"></canvas>
		
    <script type="text/javascript">

Hi,

Thanks for your quick reply! I have changed my script close clauses and that didn’t seem to work.

Just to note that this experiment runs fine on my local machine but once I have added in the the Pavlovia specific terms to the script it no longer runs through Pavlovia.

Thanks
Lexi

I think that there is an error in the instructions. Try replacing

/* init connection with pavlovia.org */
var pavlovia_init = '{'
  type: "pavlovia",
  command: "init"
'}';
timeline.push(pavlovia_init);

with

/* init connection with pavlovia.org */
		var pavlovia_init = {
			type: "pavlovia",
			command: "init"
		};
		timeline.push(pavlovia_init);

If that works, I’ll correct the docs.

Hi,

I have made that change and unfortunately the experiment is still not running.
Some of the plugins are from jsPsych 4.3 but these are saved in the repository - would this cause the experiment to run into issues?

Thanks

Just to add some more info - this is what is showing up in the markup when I try and run the experiment.

I have followed other guidance on making sure the Pavlovian plugin script is saved and called under the correct name etc but I’m still not getting anywhere.

Unexpected token } probably means you have a mismatched bracket. Can you try a search of your code and see if you have the same number of { and } brackets? Then see whether any of them are invisible to jsPsych (e.g. because they are in a comment or in quotes).