Uncaught (in promise) TypeError: Cannot read properties of undefined (reading '0')

I have managed to finally fix this issue.

I had to move the choiceBlockReps code from “begin routine” to “end routine” and it works perfectly.

Is this a quirk of JS? As it was able to accept the variable fine from where it was in Python.