psychopy.org | Reference | Downloads | Github

ReferenceError: 'Tone' is not defined

Hi all,

I keep running into the following error message when running Builder-gernerated experiments on Pavlovia:

ReferenceError: ‘Tone’ is not defined

The colour of the background is strange and the font and size of the text are all wrong. I’m using the newest version of PsychoPy Builder (2021.1.3). This error message pops up regardless of how complex/simple the experiment is. I have trailed a very simple experiment with just one textbox, and the same error is still there. I have absolutely no knowledge of coding, so could anyone tell me what is going wrong? According to some relevant posts the issue seems to be a translation error from Python to JS? But the thing is that ‘Tone’ doesn’t seem to exist in the code of my experiments…

Any help would be greatly appreciated!

Best wishes,
Xinyan

Hey @Xinyan,

That’s weird; we had a bug with Tone being undefined, but that should have been fixed a while back. Issue with Tone.js library on iOS14 + Mobile Safari · Issue #241 · psychopy/psychojs · GitHub

May I ask three questions?

  • Are you also exporting to the most recent version of PsychoPy? (see Experiment Settings → Use PsychoPy Version)
  • Which web-browser are you using?
  • Could you make me a developer of your gitlab repo?

Best, Thomas

Hi Thomas,

Thank you so much for the speedy reply!

With regard to your questions:

  • I think I was exporting to the newest version (?). Sorry I’m afraid I did not find ‘Experiment Setting - Use PsychoPy version’ in my Builder… I tried looking at ‘Preferences’, but no luck there. The oldest version I have used is 2020.2.5, and before I installed the newest version I uninstalled the older version.
  • I am using Microsoft Edge as my web browser. I think I will try my experiments on other browsers as well to try my luck.
  • I’d love to invite you as a developer on my experiments! And thank you for the offer! The only issue is that I don’t see to be able to do it, although I am the maintainer… I tried typing your name into the search bar under the tab ‘Members’ on GitLab, but to no avail.

Sorry to bother your with even more questions!

All the best,
Xinyan

Hey again,

Hmmm, let’s first check that “Use PsychoPy Version” then. Below I show where to click to get there. If you select the empty option, it will always export to the most recent version. If you had some older version there, try keeping it empty and export again.
image

Hi Thomas,

Thank you for you explanation! I’ve selected 2021.1.3 as the preferred version and updated the experiments. I’ve tried them on Google Chrome and the error message disappears - though the error is still there if I run them on Microsoft Edge. However, the experiments are still not displaying right (e.g. can’t click. text not showing, sometimes flash out, can’t go beyond the first page, etc.).

I attach the .psyexp and documents for my experiments below: new ExpI Rating and General Pilot.psyexp (82.8 KB) ExpII-IV Rating and General Pilot.psyexp (177.1 KB)

If you are willing to, could you please take a look at those and see whether there are errors there? They run well on my computer. I am also more than happy to invite you onto my project repo too.

Many thanks for your time and patience!

All the best,
Xinyan

I’ll focus on the Tone issue first. Could you share it via gitlab? Here is a tutorial: Searching for experiments on Pavlovia — PsychoPy v2021.1

Hi Thomas,

Thank you for your guidance! I have now added you to the problematic experiments (My experiments are quite large so I have included a simple token experiment named ‘Text’ that is very easy to download). All these experiments do not show well online, and the ‘Tone’ error appears with Microsoft Edge but not with Google Chrome.

The .psyexp files in the repositories have their preferred PsychoPy version set to ‘latest’ - when I explicitly set the preferred version to ‘2021.1.3’, the experiments cannot run locally anymore, with the following error appearing in the Runner:

######## Running: C:\Users\Xinyan Kou\Desktop\Text\untitled_lastrun.py #########
500.1854 INFO Loaded monitor calibration from [‘2021_03_23 12:32’]
fatal: not a git repository (or any of the parent directories): .git
Traceback (most recent call last):
File “C:\Users\Xinyan Kou\Desktop\Text\untitled_lastrun.py”, line 17, in
psychopy.useVersion(‘2021.1.3’)
File “C:\Program Files\PsychoPy3\lib\site-packages\psychopy\tools\versionchooser.py”, line 84, in useVersion
raise ValueError(msg.format(requestedVersion))
ValueError: Unknown version 2021.1.3

Experiment ended.

Thank you very much indeed, Thomas!

Best wishes,
Xinyan

Ow sorry, my mistake: version 2021.1.3 isn’t actually released yet :). I’m running it on my computer to test it before we release. Bit busy at the moment with things that came up while merging Pavlovia databases, but once the dust settled a bit I’ll dive into the Tone problem!

Hey @Xinyan, I see you shared two projects with me. Which one should I look at?

Hi Thomas, you can look at either one, as they have the same problem. Thank you so much!

Best wishes,
Xinyan

I looked at ExpII-IV RGP. I noticed a lot of issues happening, but no error message with Tone. I recommend two things:

  1. Restart with a smaller experiment and first work out the issues with that before adding features
  2. Convert your videos to this format: Media formats suitable for online studies — PsychoPy v2021.1

Thank you for the suggestions, Thomas! So in your browser the experiment displays well right? I have tried an experiment with a single textbox, but the same error also came up… It is probably too do with the video format. Thank you so much for your time!

1 Like

Hi, have you found a solution? Some of my participants reported the same error.