Stuck on initializing page - Possible problem with JS

URL of experiment:

Description of the problem:
Hi, I created the experiment in the builder and it was working just fine offline. But when I try to run it online it gets stuck on the initializing page. I know that I need to convert the code to JS but I use the 2020 version. So, if I understood correctly it is automatically converted into JS. I saw that the conditionals in stimuli component are not converted into JS automatically but rather use python syntax. I changed them manually in the JS in gitlab but still nothing changed. Someone in another post mentioned that some functions are not working online. So, I removed linspace, shuffle and .thisN to see if they were the problems but again nothing changed. When I analyzed JS that is in gitlab it says too many error, 17 % scanned but I don’t know what those errors are. Also, when I looked at the codes of online experiments I could not see what is the difference in terms of the syntax.
I would really appreciate it if someone would give me some idea about what the problem can be?

Thank you all in advance.

@Merve_Erdogan, the error I am receiving is a syntax error, given because of the use of the not keyword used in your onset condition for the random_sound sound component. Problem code:

((((w_sound == 1) && (not pressed) && (t > (tStart + a[1])))) && random_sound.status === PsychoJS.Status.NOT_STARTED)

Fix with

((((w_sound == 1) && !(pressed) && (t > (tStart + a[1])))) && random_sound.status === PsychoJS.Status.NOT_STARTED)

Thank you so much! It works now. Would you please tell me how you checked for the syntax error. I am completely new in JS and do not know what to use to detect such errors. When I tried to find it in the gitlab as I said it was just saying too many errors 11% scanned. I tried some other online tools checking for JS errors. They were also showing all the warnings that actually do not prevent the code from running but did not show syntax error. Thank you again for your help.

@Merve_Erdogan, I used the browser debugging tools. To do this, run your study, press F12, and the console tab should tell you where the error is in your .js file i.e., the line number.

1 Like