# Need help: stuck on initialising experiment

**URL:** <https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801>\
**Category:** Online experiments\
**Created:** [November 5, 2020, 3:50am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801 "2020-11-05T03:50:03Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![clawtherin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/clawtherin/32/11600_2.png) [@clawtherin](https://discourse.psychopy.org/u/clawtherin)\
**Post date:** [November 5, 2020, 3:50am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/1 "2020-11-05T03:50:03Z")

</div>

URL of experiment:

Description of the problem:  
Greetings!

I am having trouble initializing my experiment (built on PsychoPy3) online; it seems to be stuck on the initializing process. This is my first time making a project under the software, and I don’t know a thing about coding. I am hoping someone can help me.

It says UncaughtSyntax Error: Unexpected Token ‘,’ [https://run.pavlovia.org/clawtherin/xpsupra/XPSUPRA1.js](https://run.pavlovia.org/clawtherin/xpsupra/XPSUPRA1.js)  
[https://gitlab.pavlovia.org/clawtherin/xpsupra/blob/master/XPSUPRA1-legacy-browsers.js](https://gitlab.pavlovia.org/clawtherin/xpsupra/blob/master/XPSUPRA1-legacy-browsers.js)

---

<div class="post-metadata">

**Author:** ![Becca](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/becca/32/34260_2.png) [@Becca](https://discourse.psychopy.org/u/Becca)\
**Post date:** [November 5, 2020, 9:52am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/2 "2020-11-05T09:52:14Z")

</div>

This means there is a JS syntax error somewhere.

1. open developer tools as described in crib sheet. [  
https://discourse.psychopy.org/t/stuck-at-initialising-the-experiment/16406/2?u=becca](https://discourse.psychopy.org/t/stuck-at-initialising-the-experiment/16406/2)
2. click the red error message that has the name of your file (with the .js extension).
3. that will show you the line of code where you are having the error - go back to your BUILDER to fix it (e.g. it looks like an error in a text component, go to that text component to try a new option, refer to JS crib sheet for help)

Unexpected token ‘,’ means you have a comma somewhere that you need to remove, if you click on the error message in the console it should tell you what line that comma is on.

Becca

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [November 5, 2020, 10:10am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/3 "2020-11-05T10:10:34Z")

</div>

Hey @clawtherin, thanks for flagging. Versions of PsychoPy earlier than 2020.2.5 had trouble correctly generating JS for TextBox components with an empty initial value, in this case ‘Blank2’. You can find more details and a possible workaround in the following thread,

> [@Initialise experiment won't end](https://discourse.psychopy.org/t/initialise-experiment-wont-end/16481/6):
>
> I updated to PsychoPy 2020.2.4 I now receive another error message related to syncing with gitlab 311.3978 EXP Imported D:\Boelte\Eigene Dokumente\Lehre\EmpExPra\PsychoPy\AnkerExp1\AnkerStimuli.xlsx as conditions, 16 conditions, 4 params 311.4227 EXP Imported D:\Boelte\Eigene Dokumente\Lehre\EmpExPra\PsychoPy\AnkerExp1\AnkerStimuli.xlsx as conditions, 16 conditions, 4 params 311.8685 ERROR Line 222: Unexpected token , in AnkerExp1.js 311.9044 EXP Imported D:\B…

---

<div class="post-metadata">

**Author:** ![clawtherin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/clawtherin/32/11600_2.png) [@clawtherin](https://discourse.psychopy.org/u/clawtherin)\
**Post date:** [November 5, 2020, 11:06am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/4 "2020-11-05T11:06:48Z")

</div>

Many thanks, Becca! I tried to fix this earlier through that. It ran the participant box but then it said frameDur not defined. So, I tried to remake the experiment, but now I’m having trouble syncing it online. Do you have any advice for this? This is the error:

Traceback (most recent call last):  
File “C:\Program Files\PsychoPy3\lib\site-packages\urllib3\connectionpool.py”, line 384, in \_make\_request  
six.raise\_from(e, None)  
File “”, line 2, in raise\_from  
File “C:\Program Files\PsychoPy3\lib\site-packages\urllib3\connectionpool.py”, line 380, in \_make\_request  
httplib\_response = conn.getresponse()  
File “C:\Program Files\PsychoPy3\lib\http\client.py”, line 1331, in getresponse  
response.begin()  
File “C:\Program Files\PsychoPy3\lib\http\client.py”, line 297, in begin  
version, status, reason = self.\_read\_status()  
File “C:\Program Files\PsychoPy3\lib\http\client.py”, line 258, in \_read\_status  
line = str(self.fp.readline(\_MAXLINE + 1), “iso-8859-1”)  
File “C:\Program Files\PsychoPy3\lib\socket.py”, line 586, in readinto  
return self.\_sock.recv\_into(b)  
File “C:\Program Files\PsychoPy3\lib\site-packages\urllib3\contrib\pyopenssl.py”, line 298, in recv\_into  
raise timeout(‘The read operation timed out’)  
socket.timeout: The read operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “C:\Program Files\PsychoPy3\lib\site-packages\requests\adapters.py”, line 449, in send  
timeout=timeout  
File “C:\Program Files\PsychoPy3\lib\site-packages\urllib3\connectionpool.py”, line 638, in urlopen  
\_stacktrace=sys.exc\_info()[2])  
File “C:\Program Files\PsychoPy3\lib\site-packages\urllib3\util\retry.py”, line 367, in increment  
raise six.reraise(type(error), error, \_stacktrace)  
File “C:\Program Files\PsychoPy3\lib\site-packages\urllib3\packages\six.py”, line 686, in reraise  
raise value  
File “C:\Program Files\PsychoPy3\lib\site-packages\urllib3\connectionpool.py”, line 600, in urlopen  
chunked=chunked)  
File “C:\Program Files\PsychoPy3\lib\site-packages\urllib3\connectionpool.py”, line 386, in \_make\_request  
self.\_raise\_timeout(err=e, url=url, timeout\_value=read\_timeout)  
File “C:\Program Files\PsychoPy3\lib\site-packages\urllib3\connectionpool.py”, line 306, in \_raise\_timeout  
raise ReadTimeoutError(self, url, “Read timed out. (read timeout=%s)” % timeout\_value)  
urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host=‘[gitlab.pavlovia.org](http://gitlab.pavlovia.org)’, port=443): Read timed out. (read timeout=2)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py”, line 1227, in onPavloviaSync  
retVal = pavlovia\_ui.syncProject(parent=self, project=self.project)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\app\builder\builder.py”, line 1319, in project  
return pavlovia.getProject(self.filename)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\projects\pavlovia.py”, line 1101, in getProject  
repo=localRepo)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\projects\pavlovia.py”, line 346, in getProject  
return PavloviaProject(id, repo=repo)  
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\projects\pavlovia.py”, line 486, in **init**  
self.pavlovia = currentSession.gitlab.projects.get(proj)  
File “C:\Program Files\PsychoPy3\lib\site-packages\gitlab\exceptions.py”, line 242, in wrapped\_f  
return f(\*args, \*\*kwargs)  
File “C:\Program Files\PsychoPy3\lib\site-packages\gitlab\mixins.py”, line 49, in get  
server\_data = self.gitlab.http\_get(path, \*\*kwargs)  
File “C:\Program Files\PsychoPy3\lib\site-packages\gitlab\__init_\_.py”, line 517, in http\_get  
streamed=streamed, \*\*kwargs)  
File “C:\Program Files\PsychoPy3\lib\site-packages\gitlab\__init_\_.py”, line 472, in http\_request  
result = self.session.send(prepped, timeout=timeout, \*\*settings)  
File “C:\Program Files\PsychoPy3\lib\site-packages\requests\sessions.py”, line 646, in send  
r = adapter.send(request, \*\*kwargs)  
File “C:\Program Files\PsychoPy3\lib\site-packages\requests\adapters.py”, line 529, in send  
raise ReadTimeout(e, request=request)  
requests.exceptions.ReadTimeout: HTTPSConnectionPool(host=‘[gitlab.pavlovia.org](http://gitlab.pavlovia.org)’, port=443): Read timed out. (read timeout=2)

---

<div class="post-metadata">

**Author:** ![clawtherin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/clawtherin/32/11600_2.png) [@clawtherin](https://discourse.psychopy.org/u/clawtherin)\
**Post date:** [November 5, 2020, 11:07am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/5 "2020-11-05T11:07:47Z")

</div>

Many thanks, sotiri! I tried to fix this earlier through that. It ran the participant box but then it said frameDur not defined. I recreated it on Builder, but I encountered the same problem.

---

<div class="post-metadata">

**Author:** ![clawtherin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/clawtherin/32/11600_2.png) [@clawtherin](https://discourse.psychopy.org/u/clawtherin)\
**Post date:** [November 5, 2020, 11:37am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/6 "2020-11-05T11:37:41Z")

</div>

I was able to sync the study online, but just like before, it tells me about the ReferenceError: frameDur is not defined and FATAL unknown:

core-2020.2.js:1822 ReferenceError: frameDur is not defined  
at Scheduler.updateInfo [as \_currentTask] (XPSUPRA1.js:89)  
at Scheduler.\_runNextTasks (util-2020.2.js:1560)  
at Scheduler.\_runNextTasks (util-2020.2.js:1564)  
at update (util-2020.2.js:1517)  
window.onerror @ core-2020.2.js:1822

log4javascript.min.js:1 FATAL unknown | {}  
BrowserConsoleAppender.append @ log4javascript.min.js:1

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/5/d/5d45b495847ae77f6afdd7fa66339fb4b5e791a1.png)

What should I do to resolve this? Thank you in advance! 🙂

---

<div class="post-metadata">

**Author:** ![clawtherin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/clawtherin/32/11600_2.png) [@clawtherin](https://discourse.psychopy.org/u/clawtherin)\
**Post date:** [November 5, 2020, 11:38am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/7 "2020-11-05T11:38:16Z")

</div>

I was able to sync the study online, but just like before, it tells me about the ReferenceError: frameDur is not defined and FATAL unknown error:

core-2020.2.js:1822 ReferenceError: frameDur is not defined  
at Scheduler.updateInfo [as \_currentTask] (XPSUPRA1.js:89)  
at Scheduler.\_runNextTasks (util-2020.2.js:1560)  
at Scheduler.\_runNextTasks (util-2020.2.js:1564)  
at update (util-2020.2.js:1517)  
window.onerror @ core-2020.2.js:1822

log4javascript.min.js:1 FATAL unknown | {}  
BrowserConsoleAppender.append @ log4javascript.min.js:1

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/5/d/5d45b495847ae77f6afdd7fa66339fb4b5e791a1.png)

What should I do to resolve this? Thank you in advance! 🙂

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [November 5, 2020, 11:54am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/8 "2020-11-05T11:54:30Z")

</div>

Hi @clawtherin, to help with debugging is this the same repository you link to above or the xppsych one? Thanks, s.

---

<div class="post-metadata">

**Author:** ![clawtherin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/clawtherin/32/11600_2.png) [@clawtherin](https://discourse.psychopy.org/u/clawtherin)\
**Post date:** [November 5, 2020, 11:55am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/9 "2020-11-05T11:55:57Z")

</div>

Thanks for the response @sotiri! I’m using the xppsych one.

> **[data/XPPSYCH-legacy-browsers.js · 79a76e3ccf57595b2231f176005747b75f9eec23 ·...](https://gitlab.pavlovia.org/clawtherin/xppsych/blob/79a76e3ccf57595b2231f176005747b75f9eec23/data/XPPSYCH-legacy-browsers.js)**
>
> Sign In/Register

  

> **[data/XPPSYCH.js · 79a76e3ccf57595b2231f176005747b75f9eec23 · Edarl Nazario /...](https://gitlab.pavlovia.org/clawtherin/xppsych/blob/79a76e3ccf57595b2231f176005747b75f9eec23/data/XPPSYCH.js)**
>
> Sign In/Register

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [November 5, 2020, 11:58am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/10 "2020-11-05T11:58:07Z")

</div>

Ah cool thanks, let me take a look, s.

---

<div class="post-metadata">

**Author:** ![clawtherin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/clawtherin/32/11600_2.png) [@clawtherin](https://discourse.psychopy.org/u/clawtherin)\
**Post date:** [November 5, 2020, 11:59am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/11 "2020-11-05T11:59:02Z")

</div>

Thank you. 🥺🙏🏼

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [November 5, 2020, 12:24pm UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/12 "2020-11-05T12:24:22Z")

</div>

OK as it happens there must have gone something wrong when you exported for HTML from PsychoPy, because a number of variables, including `frameDur` went undeclared. I was able to fix that manually [in my fork](https://gitlab.pavlovia.org/thewhodidthis/xppsych) 😨 Basically you need to copy paste [lines 80-124](https://gitlab.pavlovia.org/thewhodidthis/xppsych/blob/master/XPSUPRA1.js#L80) onto your own XPSUPRA1 script 😉 Please let me know if you need more help, s.

> **[XPSUPRA1 \[PsychoPy\]](https://run.pavlovia.org/thewhodidthis/xppsych/)**

---

<div class="post-metadata">

**Author:** ![clawtherin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/clawtherin/32/11600_2.png) [@clawtherin](https://discourse.psychopy.org/u/clawtherin)\
**Post date:** [November 5, 2020, 12:31pm UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/13 "2020-11-05T12:31:16Z")

</div>

Thank you, @sotiri! The first routine for the welcome screen loaded, however, it seems to be stuck there and another error pops up \>\_\<

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/c/7/c7a9aee2cba2f907489533f5ebffd2900ed065d7.png) ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/3/3/33a64722a121d79310c6053bc50c135114dad587.png)

---

<div class="post-metadata">

**Author:** ![clawtherin](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/clawtherin/32/11600_2.png) [@clawtherin](https://discourse.psychopy.org/u/clawtherin)\
**Post date:** [November 5, 2020, 12:32pm UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/14 "2020-11-05T12:32:16Z")

</div>

Really appreciate you looking into my stuff. I’m having quite a hard time with the coding as I have no background whatsoever. ☹

---

<div class="post-metadata">

**Author:** ![sotiri](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@sotiri](https://discourse.psychopy.org/u/sotiri)\
**Post date:** [November 5, 2020, 12:38pm UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/15 "2020-11-05T12:38:20Z")

</div>

No problem, that is in fact an issue that has come up before and you can easily try searching discourse along the lines of [https://discourse.psychopy.org/search?q=loading%20resources](https://discourse.psychopy.org/search?q=loading%20resources) to look for an answer

---

<div class="post-metadata">

**Author:** ![Jasmine](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@Jasmine](https://discourse.psychopy.org/u/Jasmine)\
**Post date:** [January 24, 2022, 10:28am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/16 "2022-01-24T10:28:51Z")

</div>

Hello,  
my online experiment is currently stuck in ‘initialising’ as well, after it used to start normally for some time and I really can’t figure out the course. When looking into the console I see the error ‘Uncaught Syntax error: unexpected end of input’ , referring to the last line of code, which is naturally supposed to be the end of input and which I have never changed. I went through the parts of the js code that I did change to see whether I missed any closing brackets, but with 2000 lines of code there is of course still a chance that I missed something. What can I do?  
Thank you!

---

<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:** [January 24, 2022, 10:46am UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/17 "2022-01-24T10:46:24Z")

</div>

Look for unbalanced brackets in Both or JS components you’ve coded. The Auto components should be fine, since otherwise there would be a syntax error on the JS side of the code component.

---

<div class="post-metadata">

**Author:** ![Jasmine](https://avatars.discourse-cdn.com/v4/letter/j/47e85d/32.png) [@Jasmine](https://discourse.psychopy.org/u/Jasmine)\
**Post date:** [January 24, 2022, 12:18pm UTC](https://discourse.psychopy.org/t/need-help-stuck-on-initialising-experiment/17801/18 "2022-01-24T12:18:03Z")

</div>

Thanks, I found it eventually!
