Please help with PsychoPy3 error

Traceback (most recent call last):
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 1608, in onPavloviaSync
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/app/builder/builder.py”, line 894, in fileExport
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/scripts/psyexpCompile.py”, line 83, in generateScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/scripts/psyexpCompile.py”, line 221, in compileScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/scripts/psyexpCompile.py”, line 194, in _makeTarget
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/_experiment.py”, line 366, in writeScript
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/components/settings/init.py”, line 1101, in writeInitCodeJS
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.8/psychopy/experiment/components/settings/init.py”, line 1091, in prepareResourcesJS
KeyError: ‘rel’

Does rel appear in your experiment anywhere?

only in the word “release” from what I am seeing.

This error is from the code that’s trying to generate your JS file for Pavlovia, which is an odd place to hit an error. What version of PsychoPy are you using? And what permissions have you given it in MacOS?

At a glance the issue seems to be something about the file path, so it might have to do with the name of the folder you’re trying to save the experiment in, but that would be very odd.

It looks as if I am using V2024.2.4

I am not good with computers so I am not even sure about how to look into the permission for my MacOS. I have been trying to use ChatGPT to help me as much as it can throughout all of this. I am currently at a block in proceeding with my study design because of not being able to get it transferred over to Pavlovia.

Did you use ChatGPT to write Python code in Auto code components or did you use it to write JS directly?

I was using it to help me find the error. The python code I was using was from another person who I am sure did not use chat gpt to write the code. It is for a PVT assessment.

Can you please share the psyexp file? I think I need to dig into the settings to figure out why it won’t compile JS.

Yes. Thank you!
PVT-5no surveys.psyexp (36.6 KB)

Interesting. I can compile the JS file perfectly well. I wonder if actual issue is the folder that the psyexp file is saved in on your computer. Is the psyexp file on a network drive or external drive? Or some kind of temp folder? What’s the name of the folder?

If you can save the psyexp file at all it shouldn’t be system permissions, but just to be 100% sure, if you go to the Mac System Settings → Privacy and Security → Files and Folders, is PsychoPy listed? If you click on PsychoPy are all the options checked?

EDIT: I also found a couple of syntax errors in the JS code that might be causing issues (but probably not this specific error): Code_2 and Code_3 use “import” statements that won’t work. That won’t cause this error, but it will mean that they won’t work when you try to run the experiment online.

EDIT: And here’s an updated psyexp file with the problematic code removed
PVT-5no surveys_fix.psyexp (35.1 KB)

This is actually interested. So this file is not in a folder. It was given to me by another researcher. I also followed your steps to check in files and folders and looking at the screenshot, while it is listed, it is shadowed rather than being able to see the black text like the others. Thank you for providing the updated file with the code corrected!