Need help: stuck on initialising experiment

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://gitlab.pavlovia.org/clawtherin/xpsupra/blob/master/XPSUPRA1-legacy-browsers.js

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
  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

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,

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’, 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’, port=443): Read timed out. (read timeout=2)

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.

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

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

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

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

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

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


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

Thank you. :pleading_face::pray:t3:

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 :fearful: Basically you need to copy paste lines 80-124 onto your own XPSUPRA1 script :wink: Please let me know if you need more help, s.

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

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

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 to look for an answer

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!

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.

1 Like

Thanks, I found it eventually!