expInfo not defined exporting to Pavlovia (custom code component)

The solution was the same as in this post:

I put a custom code component in my very first routine. I also used expInfo in my outermost loop, so it may be the same issue as in the link above.