I posted something about this in the support forum, but after further testing it seems to be a bug, so I’m making a post here as well. If you use end() in a trial with a MouseTracker prior to creating the MouseTracker, the script freezes. PCIbex does not display an error message, but the following error appears in the JavaScript console:
Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'map')
at window.PennController._AddElementType.end (PennController.js:40:93530)
at n.end (PennController.js:33:64935)
at n.hasOwnProperty.end (PennController.js:33:48507)
at b.<computed>.<computed>.h [as endTrial] (PennController.js:33:23603)
at async PennController.js:33:63340
Here’s an experiment that serves as a MWE, at https://farm.pcibex.net/r/BtxkDp/:
PennController.ResetPrefix(null) // Shorten command names (keep this line here)
Sequence('trial')
newTrial('trial',
newText().log(), // this is just so there's a result to send, otherwise it spins forever
end(),
newMouseTracker('mouse') // comment this out, or put it before end(), and it works
)
I’ve found a workaround for my use case that just puts the MouseTracker before the end() call, but I figured this probably still isn’t the intended behavior (I didn’t see anything in the documentation).
-
This topic was modified 2 years, 2 months ago by mawilson. Reason: better defined bug