# Experiment unable to run on Pavlovia

**URL:** https://discourse.psychopy.org/t/experiment-unable-to-run-on-pavlovia/13031
**Category:** Online experiments
**Created:** [May 5, 2020, 3:09pm UTC](https://discourse.psychopy.org/t/experiment-unable-to-run-on-pavlovia/13031 "2020-05-05T15:09:13Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![lpxhs5](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@lpxhs5](https://discourse.psychopy.org/u/lpxhs5)
#### Post date: [May 5, 2020, 3:09pm UTC](https://discourse.psychopy.org/t/experiment-unable-to-run-on-pavlovia/13031/1 "2020-05-05T15:09:13Z")

</div>

URL of experiment: [Pavlovia](https://pavlovia.org/lpxhs/carracinggame)

Description of the problem:  
When I try to run my experiment on Pavlovia, I see the dialog box and then just a blank grey screen and nothing happens.

This is the error message that I get from the Javascript console:  
 ![Screenshot 2020-05-05 at 16.03.12](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/b/6/b6449c547b257da11c734acdda38f7212c3636ea.png)

These screenshots show the contents of all my code snippets:  
 ![Screenshot 2020-05-05 at 16.26.05](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/d/fdbc147ea55130bca12f2bb72f11647aa81f2917.png) ![Screenshot 2020-05-05 at 16.26.16](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/8/d/8d7ba0c1d4ff634510a27b3bf7d49d7d3d624447.png) ![Screenshot 2020-05-05 at 16.26.21](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/0/7/0741794048e4e8aa3c69ac4899c1630ce7ba9462.png)

 ![Screenshot 2020-05-05 at 16.26.36](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/1/4/141fe4bfc7234ef3e3b739245472f8debb21b400.png) ![Screenshot 2020-05-05 at 16.26.43](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/1/41807dd7de4970466f3d03fb7de9f25b79cc2657.png) ![Screenshot 2020-05-05 at 16.26.52](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/d/6/d6617cca75d43f9e92a64bccccd1ec2b86da8a2e.png) ![Screenshot 2020-05-05 at 16.27.04](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/3/c/3c26d41439400871b935f59c2e638ffc8b9d6cc5.png) ![Screenshot 2020-05-05 at 16.27.09](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/1/2/12a112218181f2033e9901cca5f7ae17c7e897dd.png) ![Screenshot 2020-05-05 at 16.27.51](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/9/c/9cbce3915b1f597a6604f5eae2cb951317dc0cbb.png)

It seems there’s an issue with the images that I’m using?  
My experiment has quite a few code components and I was wondering if that may be part of the issue.  
How can I solve this?

Thank you in advance!

---

<div class="post-metadata">

### Author: ![jonathan.kominsky](https://avatars.discourse-cdn.com/v4/letter/j/a587f6/32.png) [@jonathan.kominsky](https://discourse.psychopy.org/u/jonathan.kominsky)
#### Post date: [May 5, 2020, 4:05pm UTC](https://discourse.psychopy.org/t/experiment-unable-to-run-on-pavlovia/13031/2 "2020-05-05T16:05:06Z")

</div>

All of your code appears to by pure Python code. You will need to change each one’s “code type” (the drop-down menu at the top of the window) to auto-\>JS to make it generate the appropriate JavaScript code (this requires the most recent version of PsychoPy).

There are a couple of things that probably won’t translate very well, at a glance core.Clock will need to be changed to “util.Clock” in the JavaScript, and STARTED will need to be PsychoJS.status.STARTED. @wakecarter has assembled a handy guide to code translation pitfalls here:

> **[PsychoPy Python to Javascript crib sheet](https://docs.google.com/document/d/13jp0QAqQeFlYSjeZS0fDInvgaDzBXjGQNe4VNKbbNHQ/edit)**
>
> PsychoPy Python to Javascript crib sheet Compiled by Wakefield Morys-Carter, Oxford Brookes University PsychoPy 2020 has an automatic Python to Javascript translation tool. This document contains information about code that is not translated...

---

<div class="post-metadata">

### Author: ![lpxhs5](https://avatars.discourse-cdn.com/v4/letter/l/cab0a1/32.png) [@lpxhs5](https://discourse.psychopy.org/u/lpxhs5)
#### Post date: [May 6, 2020, 12:41pm UTC](https://discourse.psychopy.org/t/experiment-unable-to-run-on-pavlovia/13031/5 "2020-05-06T12:41:11Z")

</div>

Thank you for your reply!

I’ve changed everything as suggested/following the linked guide, but I am still getting a blank screen. They study then attempts to save the results and quits after a few seconds.

From psychopy, it seems javascript doesn’t like the continue and break:

 ![Screenshot 2020-05-06 at 13.55.08](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/5/2/5266156b744b0f34f6af74097d901ff0f21f2b65.png)

How do I fix this?

My updated experiment is here: [Pavlovia](https://pavlovia.org/lpxhs/cargame)

Thank you for all your help!

---

<div class="post-metadata">

### Author: ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)
#### Post date: [May 6, 2020, 1:08pm UTC](https://discourse.psychopy.org/t/experiment-unable-to-run-on-pavlovia/13031/6 "2020-05-06T13:08:38Z")

</div>

I’ve downloaded it and found a couple of errors.

You can’t define the window colour as black since this happens before black itself gets defined. However, there shouldn't be any problem with [-1.000,-1.000,-1.000]

In the Python use core.clock() not util.Clock()

Equally, Math is just for the Javascript version.

I would recommend you get the experiment working locally and then use my crib sheet to help refine the translations (switching the code components to both so you don’t have to break the Python code in the process).

Best wishes,

Wakefield
