Uncaught SyntaxError: Unexpected token '.'

Hi, I exported the js script from my psychopy builder. When I try to run it on pavlovia, I get the error shown in the title. It says the error is in the line below, but it doesn’t seem to make sense.

function util.roundLoopBegin(util.roundLoopScheduler, snapshot) {

I noticed that someone ran into the same issue before on the forum, and the response was a bug in pavlovia that should now be fixed. But somehow I’m getting the same error again. Could someone please take look? Thanks!

I also noticed that somehow when I export html from the builder, a lot of variables in the output js file are undeclared. This wasn’t a problem before. Maybe the new psychopy version somehow introduced this bug? It’s too painstaking to manually add “var” ahead to hundreds of variables in the script. Could someone please take a look?

I think I figured out the problem. One of my loops was named “round” and this caused all aforementioned problems. Once I renamed the loops the issue magically went away…

1 Like