jsPsych icon indicating copy to clipboard operation
jsPsych copied to clipboard

data-only simulation causes "Maxmum call stack size exceeded" error

Open toreerdmann opened this issue 1 year ago • 1 comments

Hi, I have quite a long experiment and am not able to use the "data-only" simulation mode.

Here's the error message:

image

Here's a minimal experiment that causes the error:

 <!DOCTYPE html>
  <html>
      <head>     
      <script src="https://unpkg.com/[email protected]"></script>
      <script src="https://unpkg.com/@jspsych/[email protected]"></script>
      </head>
      <body></body>
      <script>
      let jsPsych = initJsPsych();
      let trial = {
          timeline: [
          {
              type: jsPsychHtmlKeyboardResponse,
              stimulus: "test",
              choices: ["a"],
          }],
          repetitions: 900
      };
      jsPsych.simulate([trial]);
      </script>
</html>

I am happy to help fixing this, but I do not know where to start. I am guessing the simulation would have to be run in an iterative way, that does not grow the call stack as much.

toreerdmann avatar Jun 11 '24 16:06 toreerdmann

Thanks, this is really helpful information.

We are getting close to publishing version 8, and I suspect that this is likely fixed in version 8 due to the overhaul to the timeline implementation code. I'll work on adding a test case to verify that it is fixed.

jodeleeuw avatar Jun 11 '24 21:06 jodeleeuw

We've confirmed that this is no longer an issue in version 8.

jodeleeuw avatar Jul 11 '24 16:07 jodeleeuw