SyntaxError: Cannot use import statement outside a module

URL of experiment: Epi_Cat [PsychoPy]

Description of the problem: Hello, I have had a repeating issue when trying to run my experiment from PsychoPy Builder online through Pavlovia.

Every time we synch to Pavlovia when we go to pilot the experiment we get the error: SyntaxError: Cannot use import statement outside a module

We are not sure what is causing this error because the experiment runs perfectly in PsychoPy and we have been able to successfully upload and run 31 participants online. We re-synched due to minor changes in the task and upon re-synching we ran into the issue.

We have tried everything we can think of: cleared all meta data on the computer that was doing the synch to Pavlovia, we tried deleting the experiment in Pavlovia and re-uploading it, we had different accounts try to upload, we used different computers to upload to Pavlovia, we also have tried uploading a very basic task to see if that would work and it did not, we got the same error. We even tried uploading the version that had originally worked online and we got the same error.

Each time we try to pilot it looks like it is downloading everything properly and then when the progress bar is almost complete it displays the error.

If anyone has any suggestions on things we could try, or solutions as to how to solve this error it would be greatly appreciated!


Screenshot 2024-06-04 at 11.38.11 AM

Have a look at the developer console for more details about the error.

Does you have an import statement in a custom code component?

https://psychopy.org/online/psychoJSCodingDebugging.html

1 Like

We do have a Prolific completion code but the code did originally work and it has not changed.

That shouldn’t use import.

What line of code does the developer console point to?