Sorry to bother you, I actually try some things before coming here to ask for help, but still couldn’t solve it on my own… I’m getting the “Failed to parse as JS” error, and can’t either Sync to pavlovia.
I followed your advice, and changed the code component:
This is on “each frame” tab, in JS code type
if (mouse_3.getPressed()[0] === 1) {
clickable = [respuestaFemenino, respuestaMasculino];
for (const obj of clickable) {
if (obj.contains(mouse_3)) {
if (timer.getTime()<3) ) {
muyRapido.autoDraw = true;
} else if (timer.getTime()>6) ) {
muyLento.autoDraw = true;
}
mouse_3.setPos((0,0));
psychoJS.experiment.addData('RT', timer.getTime());
continueRoutine = false;
}
}
}
Then i have a " timer = core.clock();" on “begin routine” and a "mouse_3.setPos((0,0)); " on end routine.
However, when I try to export the HTML , it shows the error you mentioned above: “Failed to parse as JS by esprima” (it gives the error 2 times)
Also, If I try to Sync with pavlovia, it get’s stuck on “Synchronizing…” and does not upload the repo. (with no error shown)
I searched and found what you’ve already told me about the lowercase in true/false but that’s already done. I have 2 other code components in other routines, that only have a “mouse.setPos((0,0))” line on begin or end routine tab. I tried cutting that line and pasting it in JS code type, for it to be "mouse.setPos((0,0)); " then compile, then export html but does the same. (also tried leaving those code components in Py code type, but same result)
EDIT:
So, I tried to do a fresh upload to pavlovia. And after I save the project, compile, export to html (with Failed parse as JS error…" , and start the new project on pavlovia, It shown this on the coder “output” tab:
AttributeError: ‘NoneType’ object has no attribute ‘project’
Traceback (most recent call last):
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\pavlovia_ui\menu.py”, line 121, in onNew
syncProject(parent=self.parent, project=projEditor.project)
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\pavlovia_ui\project.py”, line 488, in syncProject
infoStream=syncFrame.syncPanel.infoStream)
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\app\pavlovia_ui\functions.py”, line 96, in showCommitDialog
changeDict, changeList = project.getChanges()
File “C:\Program Files (x86)\PsychoPy3\lib\site-packages\psychopy\projects\pavlovia.py”, line 915, in getChanges
raise ValueError(“Found an unexpected change_type ‘{}’ in gitpython Diff”.format(this.change_type))
ValueError: Found an unexpected change_type ‘U’ in gitpython Diff