Psycholinguistics easier than ever before!

Troubleshooting

If you're testing your experiments and they don't work, the first step is to diagnose the problem. When you simply open the HTML file and run the experiment in a browser, you don't automatically see error messages when something goes wrong, but they are there. To access them you just have to open the browser's console, either by using shortcuts:

  • Apple: Option + ⌘ + I (in most browsers) → in Safari: Option + ⌘ + C
  • Windows/Linux: Ctrl + Shift + I (in most browsers) / Ctrl + Shift + K
Or you can right click anywhere on the page and choose the option 'inspect'. You can also get there via the browser's menu under More Tools > Tools for Web-Developers (or something similar; different browsers may use different names).

If you only see the experiment's HTML code, you need to switch to the console tab to view error messages.

Here are some common errors:


This means that the jsPsychHtmlKeyboardResponse plugin was not included in the documents head.

This means that the variable 'targek' was called but never defined, which is the result of a misspelling of the variable's actual name 'target'.

This error implies that there is an opening curly brace '{' that hasn't been closed with a closing curly brace '}'. While this is sometimes the case, this error also occurs when there is a missing comma between parameters in the trial in question, which happens more regularly and is often difficult to spot.

Are all needed plugins/scripts included in the `<head>`?
Are all referenced file/directory names correct and do the associated files (e.g images) exist?
Did you call all timeline variables correctly (only applies in jsPsych version 8 and newer)?
if you're calling them from inside a function use `jsPsych.evaluateTimelineVariable()`
otherwise use `jsPsych.timelineVariable()`
Did you push all your trials to the timeline?
Did you run the timeline with `jsPsych.run()`?
Are all JATOS commands, if any, commented out? Or if you are running the experiment on JATOS, are all of them included?
There are no errors in the browser console?

If the answer to any of the above is 'No', then great, you have most likely found the problem and can fix it. If the answer to all of them is 'Yes', maybe try a different browser or hosting solution and see if the problem persists or if you can get more information.