psychopy.org | Reference | Downloads | Github

Builder-only experiment throws "ReferenceError: Rect is not defined" on Pavlovia

I made a simple experiment with only Polygons and Keyboard events in the builder. It works fine locally, but when I export HTML and push to Pavlovia, I get this error:

The only place that Rect appears in the generated js code is:

  // Initialize components for Routine "trial"
  trialClock = new util.Clock();
  rectangle1 = new Rect ({
    win: psychoJS.window, name: 'rectangle1',
    units: psychoJS.window.units,
    width: [0.5, 0.5][0], height: [0.5, 0.5][1],
    ori: 0, pos: [0, 0],
    lineWidth: 1, lineColor: new util.Color([1, 1, 1]),
    fillColor: new util.Color([1, 1, 1]),
    opacity: 1, depth: -1.0, interpolate: true,
  });

I’m probably missing something simple here, but if anyone could point it out it’d be much appreciated!

1 Like

Hi, I meet a similar problem. RefrerenceError: None is not defined. I try to run the experiment a lot times, but it still not work. The local experiment is normal running in my computer. Can someone give some advice? Thanks!

Hi, I’m also having this issue with Sound:

This is my first time trying to use PsychoPy online, but the documentation says that sound is supported, right? (Like you two, mine works fine locally.)

I found my issue was caused by a blank screen(a text stimulus without any text). So, I solved my issue by add a * mark in blank text content.

Hm, that’s not my problem, all my audio is defined as tones (at first I thought it might be my audio files that set every repeat, so I tested it replacing them with tones). I don’t know Js well enough to know if there’s a mistake in the code translated from python – maybe Js represents tones differently?

Hi, thanks for reporting these errors, they relate to changes in how the Python>JS code translation and both will be fixed in the next release, coming in a few days.

2 Likes

Thanks for your reply. Looking forward to the new release of Pychopy3.

Tried it again last night with the beta 12 build and this error was fixed!

I’m still facing this problem with PsychoPy v3-1-0.
Specifically, task written in Builder runs smooth on my machine, but on Pavlovia ReferenceError pops up. Problematic reference is a variable with image name defined in ‘Begin experiment’ code block.
Is there a solution?

[see other comment here]