Task runs as expected on my local machine but code components are generating errors when uploaded to Pavlovia

The # Load your CSV once: section will need to be in a Both code component.

Move your function definitions to Before Experiment