# Issues getting started

**URL:** <https://discourse.psychopy.org/t/issues-getting-started/8672>\
**Category:** Online experiments\
**Created:** [July 30, 2019, 11:42am UTC](https://discourse.psychopy.org/t/issues-getting-started/8672 "2019-07-30T11:42:00Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheSav](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/thesav/32/9518_2.png) [@TheSav](https://discourse.psychopy.org/u/TheSav)\
**Post date:** [July 30, 2019, 11:42am UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/1 "2019-07-30T11:42:00Z")

</div>

[https://run.pavlovia.org/TheSav/v3\_conda/html/](https://run.pavlovia.org/TheSav/v3_conda/html/)

Description of the problem:

Hi, I’ve been trying to create an online version of a latent inhibition program (that works perfectly but I’m having a few issues.

Here are some assumptions I am making about the process (which I may be wrong about);

1. When I click the “sync with web project” button in PsychoPy 3.1.5, a html folder is created and there should be a corresponding .js file created with the same name as the project that is created and uploaded to the pavlovia server. At present, this file does not appear.

2. The online program stalls at the ‘initialising the experiment’ phase as I think it cannot load the corresponding .js file ([https://run.pavlovia.org/TheSav/condition\_a\_mg/html/Practical\_Prog\_A.js](https://run.pavlovia.org/TheSav/condition_a_mg/html/Practical_Prog_A.js)).

3. The program has some coder elements that I presume I will need to create native javascript for in the “code properties” box when showing “code type” both. I’ve yet to do this but would this cause the .js file to not be created?

Am I missing something?

Regards, Justin.

---

<div class="post-metadata">

**Author:** ![carlijn](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@carlijn](https://discourse.psychopy.org/u/carlijn)\
**Post date:** [July 30, 2019, 7:40pm UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/2 "2019-07-30T19:40:56Z")

</div>

Hi Justin, welcome! I think for point 1 and 2, me and someone else are having the same issue, see  
[here](https://discourse.psychopy.org/t/on-line-issues-with-pavlovia/8562/4), just in case there might be an answer there earlier than there is in this thread. Sorry I can’t help you, I’m having the same problem - no .js files, and stuck on initialising. (If you figure it out please let me know how you did it!)

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [July 30, 2019, 9:22pm UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/3 "2019-07-30T21:22:03Z")

</div>

Hi @TheSav, and @carlijn, yes I believe your issues will be related to an error in your code components, or somewhere in your Builder components where you have inserted some custom code. If there is a syntax error in your code components, your JS will not be created. There should be an error output when you try to compile/sync your HTML/JS. To check, from Builder, open a Coder window or just compile your script into Python and the Coder window will open. Then, try to sync you experiment again. Any errors should appear in the Coder output window.

---

<div class="post-metadata">

**Author:** ![carlijn](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@carlijn](https://discourse.psychopy.org/u/carlijn)\
**Post date:** [July 30, 2019, 9:45pm UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/4 "2019-07-30T21:45:53Z")

</div>

Hi @dvbridges thanks for your reply. I do not have any code components in either of the files, because I don’t know JS I hardcoded everything I needed in my conditions file. So is there anything else that could cause this problem? Thanks in advance!

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [July 30, 2019, 9:53pm UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/5 "2019-07-30T21:53:23Z")

</div>

Ok great, I still recommend you try the steps above then copy and paste any errors that appear.

---

<div class="post-metadata">

**Author:** ![Daiki](https://avatars.discourse-cdn.com/v4/letter/d/5f9b8f/32.png) [@Daiki](https://discourse.psychopy.org/u/Daiki)\
**Post date:** [July 30, 2019, 10:00pm UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/6 "2019-07-30T22:00:09Z")

</div>

Hi Justin @TheSav,

From my experience, it is a translating problem of PsychoPy, from .psyexp (XML format) to .js (JS format). PsychoPy would fail to interpret and translate some component’s parameters and could not export as HTML.

And that is why your online program stalls at the ‘initializing the experiment’ phase, I think.

I also have met the same issues before.  
Do you set a conditional expression as a parameter in some components? (text of the text component, or start/stop of every component, etc.)  
If you are comparing variables in a conditional expression, it is likely that cause the problem.

Because Python and Javascript have different syntax for large and small comparisons, it can cause problems when interpreting and translating your experiment.

Check your experiment in Builder.  
If you set a conditional expression in some component parameter, you can achieve the same behavior in other ways.  
(i.e. Define the parameter as a variable in code component separately for Python and Javascript, using a conditional expression, and set “($) + the variable name” in individual components.)

I’m still a beginner and I don’t know the details, but I hope I can help you solve the problem.

---

<div class="post-metadata">

**Author:** ![carlijn](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@carlijn](https://discourse.psychopy.org/u/carlijn)\
**Post date:** [July 30, 2019, 10:40pm UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/7 "2019-07-30T22:40:06Z")

</div>

![53%20PM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/7/f778a6d0e629f1fafc998819b7ebe62cd0b0a212.png) ![00%20PM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/e/8/e8ded7c8eaa73d679fc5a87c7510fecc5df89439.png) ![20%20PM](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/f/6ffb5cbccec24b6529d205013d231e1c75a5abfd.png) Hope this helps!

Sorry for the many screenshots I’m working from a small screen now.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [July 31, 2019, 9:22am UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/8 "2019-07-31T09:22:41Z")

</div>

@carlijn, that error looks like a networking issue, which is separate to the original problem. I have had a look at your `newcd` project and the reason for the failure to compile is the use of the `cross` shape in polygon. There should have been an error raised output saying that this shape is currently not supported for JS, but that appears to have not been reached above due to the networking error. The good news is you can make your own cross using a text stim e.g., “+”, you can overlay to rectangle stim to make a cross, or you can use a cross from an image file.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [July 31, 2019, 9:55am UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/9 "2019-07-31T09:55:52Z")

</div>

@TheSav, just looking into your issue now, which similarly appears to be related to the use of Polygon stim that are in development, causing the JavaScript compiler to fail. Will let you know shortly how it is possible to draw circle stim.

---

<div class="post-metadata">

**Author:** ![TheSav](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/thesav/32/9518_2.png) [@TheSav](https://discourse.psychopy.org/u/TheSav)\
**Post date:** [July 31, 2019, 11:38am UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/10 "2019-07-31T11:38:48Z")

</div>

@dvbridges Ok brill. I tried all your suggestions above and found no errors. I’ll tinker with removing the polygon and see what happens.

---

<div class="post-metadata">

**Author:** ![TheSav](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/thesav/32/9518_2.png) [@TheSav](https://discourse.psychopy.org/u/TheSav)\
**Post date:** [July 31, 2019, 11:43am UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/11 "2019-07-31T11:43:42Z")

</div>

So just to confirn, when I remove the polygon elements the js now generates.

---

<div class="post-metadata">

**Author:** ![dvbridges](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/dvbridges/32/1918_2.png) [@dvbridges](https://discourse.psychopy.org/u/dvbridges)\
**Post date:** [July 31, 2019, 12:16pm UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/12 "2019-07-31T12:16:12Z")

</div>

Thanks @TheSav, the issue is with `regular polygon`, which Alain is implementing very soon. For now, the supported shapes for online studies include lines, triangles and rects.

---

<div class="post-metadata">

**Author:** ![TheSav](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/thesav/32/9518_2.png) [@TheSav](https://discourse.psychopy.org/u/TheSav)\
**Post date:** [July 31, 2019, 12:36pm UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/13 "2019-07-31T12:36:51Z")

</div>

@dvbridges - ok thanks for the info. I’ve now successfully replaced the circle polygon with a transparent circular gif which seems to be working in builder.

---

<div class="post-metadata">

**Author:** ![carlijn](https://avatars.discourse-cdn.com/v4/letter/c/bbe5ce/32.png) [@carlijn](https://discourse.psychopy.org/u/carlijn)\
**Post date:** [July 31, 2019, 2:50pm UTC](https://discourse.psychopy.org/t/issues-getting-started/8672/14 "2019-07-31T14:50:58Z")

</div>

thank you so much, it works now indeed!! 👏  
just wondering if the overwriting with an old file (as I wrote here [On-Line Issues with Pavlovia](https://discourse.psychopy.org/t/on-line-issues-with-pavlovia/8562/4)) had anything to do with this/anything else and/or if that is a known problem?
