Trial level node is missing the "type" parameter. #1390
-
I have a section of code that used to be part of a huge function but I have split into smaller sections to make it more manageable and to allow more communication with a websocket server, and now that this section is a single function it no longer works. The only part that is new is the jsPsych.init and the fact that this is now a standalone function. I get the following error: "Trial level node is missing the "type" parameter. The parameters for the node are: {"0":{"type":"instructions","pages":["long list of instructions that I have removed for brevity!"],"show_clickable_nav":true},"1":{"type":"html-button-response","stimulus":"Press START to begin your training","choices":["START"]}}" I have specified type for both nodes and I don't know where the 0 and 1 come from in the list of parameters given by the error. full code:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Hi @JulietDunstone, this "Trial level node is missing the "type" parameter" error often happens when there's something wrong with the timeline. In your case, I think the problem is that the jsPsych.init({
timeline: timeline,
... Does that work? |
Beta Was this translation helpful? Give feedback.
Hi @JulietDunstone, this "Trial level node is missing the "type" parameter" error often happens when there's something wrong with the timeline. In your case, I think the problem is that the
timeline
variable is an array, but then you put it inside of another array injsPsych.init
, which turns it into a nested array. So you can just remove the square brackets around your timeline array:Does that work?