JS Console Error: "Uncaught SyntaxError: Unexpected string"

URL of experiment: ansArousal2 [PsychoPy]

Description of the problem: We recently switched to 2022.1.1 and updated an older program that was running fine in the last 2021 release. It runs fine locally, but when synced the Javascript Console throws a “Uncaught SyntaxError: Unexpected string” for Line 528, which is this in the js file:

psychoJS.experiment.dataFileName = (("." + “/”) + (u’data/%s_%s’ % [expInfo[‘participant’], expName]));

I originally suspected it may have something to do w/ the date format change in 2022.1.1 and therefore removed the date from the data entirely, but it’s still happening as can be see in the code above. Thanks for any help you can offer!

Are you trying to override the default data file name?

No, we are not. The settings data file for the project should have always been the default, and didn’t work as such either. I just removed the expInfo[‘date’] and a corresponding %s when it didn’t work with the default because I thought it might be due to the date format change in 2022.1.1, but that did not fix it, either.

I think you may have made a mistake here, so the file doesn’t work properly

I’m not sure where the error is. I just replaced the “Data Filename” with

u’data/%s_%s_%s’ % (expInfo[‘participant’], expName, expInfo[‘date’])

and it still throws the same error for line 528, which is now this:

psychoJS.experiment.dataFileName = (("." + “/”) + (u’data/%s_%s_%s’ % [expInfo[‘participant’], expName, expInfo[‘date’]]));

Does anybody spot anything unsual here? I am literally doing the default Data Filename setting at this point.

I’m encountering a similar error:

SyntaxError: Unexpected string literal ‘data/%s_%s_%s’. Expected ‘)’ to end a compound expression.

I didn’t try to customize the data filename at all. Did you find a solution to this problem?

I did manage to fix it, though I still don’t understand what the problem was: I had to make a new experiment in 2022.1.1, and then copy and paste routines from the old version to the new one. That fixed it for whatever reason.