psychopy.org | Reference | Downloads | Github

Unspecified JavaScript Error in Chrome for /almost/ all experiments but not in Firefox

Even after syncing an extremely simple experiment (text with keyboard press to end experiment) to Pavlovia, when I try to run it in Chrome, I get the errors I copied below. As you’ll notice, the errors are listed as happening in the core psychopy.js code, not my own. Weirdly however, a couple of my experiments that I uploaded a while ago would work in Chrome. Also, running the experiments in Firefox works just fine. Going to use that work around for now, but eventually want to include an experiment in an online survey, so really hope that other people using Chrome will be able to use my experiments.

Error #1 ((Bolded text is the referenced line)

window.onerror @ core-2020.2.js:1846
_captureErrors()
{
this.logger.debug(‘capturing all errors using window.onerror’);
const self = this;
window.onerror = function (message, source, lineno, colno, error)
{
console.error(error);
self._gui.dialog({“error”: error});
return true;
};
}
Null

Error #2 (A bunch of them so didn’t go through pulling the referenced line each time)

Fatal unknown | null
BrowserConsoleAppender.append @ log4javascript.min.js:1

BrowserConsoleAppender.append @ log4javascript.min.js:formatted:1635
Appender.doAppend @ log4javascript.min.js:formatted:843
Logger.callAppenders @ log4javascript.min.js:formatted:509
Logger.log @ log4javascript.min.js:formatted:502
fatal @ log4javascript.min.js:formatted:622
dialog @ core-2020.2.js:1157
window.onerror @ core-2020.2.js:1847

Hi There,

This is indeed a tricky error to debug. One solution I have found to work if that suggested on the crib sheet PsychoPy Python to Javascript crib sheet - Google Docs ).

The step by step stages for implementing that are:

a. Experiment settings> export html > set as manual

b. make any edits to builder file (e.g. adding components setting text size etc.)

c. File > export html

d. open up index.html in text editor

e. replace pixi in html (using the lines specified in the crib sheet)

f. sync s usual and run in browser

Hope this helps,
Becca

@Becca Thanks so much, that solution did indeed work when I tried it out in my simple test experiment. I am going to hold off on implementing it in my actual main experiment program until I’m sure that it’s pretty much done so that I don’t need to repeatedly fix that line in the HTML document.

For the people finding this forum post weeks later, here’s the relevant text she referrred to in the Crib Sheet:

If the experiment works on some browsers but not others try editing the index.html file directly to replace <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/pixi.js/5.3.3/pixi.min.js"></script>
with <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/pixi.js-legacy@5.3.3/dist/pixi-legacy.min.js"></script>

  • @Becca Piece of feedback for the PsychoPy team. I had indeed looked at the Javascript crib sheet while trying to solve this problem, but I hadn’t read it front to back recently. I might suggest that the PsychoPy documentation page for running online experiments be edited to include a mention that there is a handy guide to specific error messages and potential solutions in the crib sheet. As it stands, the online documentation describing how to find the problem and how to solve it don’t really emphasize that there is a list of this failure-to-run errors and potential solutions in the crib sheet (in fairness, it is mentioned en passant above in the common problems section, but not emphasized).

  • One last piece of feedback. The online studies section of the PyschoPy documentation and its subpages appear to me to be particularly out of date. N00bs such as myself go first to the documentation rather than the release notes and message board announcements (as the more sophisticated leet H4X0Rs might :slight_smile: ). Bottom line, it might be worth prioritizing updating that part of the documentation, if only by deleting obsolete stuff and refering folks to the relevant forum posts and locations in the Crib Sheet.

Thanks again!

Hey,

Pleased that solved your problem and thanks for the feedback. The team are working on it as documentation must keep up with the growing pace of development. (although the crib sheet is currently listed as one of the three recommended resources for getting online Creating online studies from Builder — PsychoPy v2020.2 and is a pinned post in the discourse - so we hope most people find it!)

In the meantime, can I also highlight that PsychoPy is an open source project and contributions from the community are always welcome! Indeed, up untill the last year or so psychopy was entirely developed by a volunteer base Contributors to psychopy/psychopy · GitHub. So, if you ever have recommendations for documentation edits those can be suggested through editing the .rst files here psychopy/docs/source/online at master · psychopy/psychopy · GitHub and submitting a pull request. I recognize not everyone has the time to contribute to projects such as this, but also not everyone realises anyone can make direct suggestions on the docs at any time! :slight_smile: so thought I would highlight that too! (it’s kind of cool to be listed as a “contributor” :joy: )

Becca

Thanks Becca, didn’t realize I could contribute to documentation, may take a crack at that some day, in the mean time, will try to document things as best I can in message board so shows up in Google searches :slight_smile:

1 Like

Hello! I am having a similar issue - I am running an online experiment, and one of the participants so far told me that their browser showed an Unspecified JS error on Chrome (Windows 10 Pro). They tried restarting the experiment but it still did not work. They also sent me the console log:

audio-context-constructor.js:9 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
(anonymous) @ audio-context-constructor.js:9
test-audio-node-disc…method-support.js:3 [Deprecation] The ScriptProcessorNode is deprecated. Use AudioWorkletNode instead. (https://bit.ly/audio-worklet)
(anonymous) @ test-audio-node-disc…method-support.js:3
test-audio-node-disc…ethod-support.js:30 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
(anonymous) @ test-audio-node-disc…ethod-support.js:30
test-audio-scheduled…meters-support.js:4 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
re @ test-audio-scheduled…meters-support.js:4
constant-source-node-constructor.js:42 The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu
start @ constant-source-node-constructor.js:42
log4javascript.min.js:1 INFO unknown | [PsychoJS] Detected browser: Chrome
log4javascript.min.js:1 INFO unknown | [PsychoJS] Initialised.
log4javascript.min.js:1 INFO unknown | [PsychoJS] @version 2020.2
log4javascript.min.js:1 INFO unknown | [PsychoJS] Open Window.
core-2020.2.js:1846 null
window.onerror @ core-2020.2.js:1846
log4javascript.min.js:1 FATAL unknown | null
BrowserConsoleAppender.append @ log4javascript.min.js:1

The issue is, my experiment involves no audio whatsoever, only a small set of image files, so I found it very strange that there was this error. None of my other participants so far reported the error, and I haven’t experienced it either (I use Chrome too). Would the same solution suggested above work here, or would I need to try something else?
Thank you!