| Reference | Downloads | Github

Java Script syntax error

Hi all,

I am using PsychoPy 3.1.5. Win 10.


I was trying to run my experiment online, but it is stuck on ‘‘initialising the experiment’’. Web console says that there is ‘‘Uncaught SyntaxError: missing ) after argument list’’ at line 1187:

-------Ending Routine “pamcenje”-------

for thisComponent in pamcenjeComponents:
    if hasattr(thisComponent, "setAutoDraw"):
vjezba.addData('image_3.started', image_3.tStartRefresh)
vjezba.addData('image_3.stopped', image_3.tStopRefresh)
vjezba.addData('text_12.started', text_12.tStartRefresh)
vjezba.addData('text_12.stopped', text_12.tStopRefresh)
# check responses
if key_resp_5.keys in ['', [], None]:  # No response was made
    key_resp_5.keys = None
if key_resp_5.keys != None:  # we had a response
    vjezba.addData('key_resp_5.rt',  key_resp_5.rt )
vjezba.addData('key_resp_5.started', key_resp_5.tStartRefresh)
vjezba.addData('key_resp_5.stopped', key_resp_5.tStopRefresh)

These lines look like this, and I couldn’t see where the problem was. I’ve also tried to use JSHint to see was there any syntax error, but I don’t see any.

Thank you in advance for your help,


Your code above is Python syntax, not JavaScript. Was this somethign you inserted in a Code Compoent?

Yes, this is a part of my Code Component (shortcut to Compile to Script).

Now I have checked my code via Python Buddy and found the missing bracket, but in Google Chrome it still shows the same error: ‘‘Uncaught SyntaxError: missing ) after argument list’’ and is stuck on initialising the experiment.

I have realized that once I fix the code in Python and save, that it is saved in new file and if I open the Builder file again, the code is not fixed? I think this is what is causing the problem, but how can I fix this?

Sorry for bothering,