# I cannot translate the script into JS in Psychopy Builder

**URL:** <https://discourse.psychopy.org/t/i-cannot-translate-the-script-into-js-in-psychopy-builder/23640>\
**Category:** Online experiments\
**Tags:** pavlovia\
**Created:** [June 19, 2021, 5:21am UTC](https://discourse.psychopy.org/t/i-cannot-translate-the-script-into-js-in-psychopy-builder/23640 "2021-06-19T05:21:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![11133](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/11133/32/16606_2.png) [@11133](https://discourse.psychopy.org/u/11133)\
**Post date:** [June 19, 2021, 5:21am UTC](https://discourse.psychopy.org/t/i-cannot-translate-the-script-into-js-in-psychopy-builder/23640/1 "2021-06-19T05:21:35Z")

</div>

Hello, everyone.  
I’m a Psychopy Beginner and trying to make the program for the online survey.  
The task is the spot-difference task for children. In that experiment, the participants will click the different parts of the image and they will get the feedback. Fortunately, the program works in the Local. However, I clicked the following button, but the error occurs. I don’t know what to do, and even which line should I see? (Python code or something else?)

 ![スクリーンショット 2021-06-19 13.45.05](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/c/fce5e8c7252584d46fa243ef5eba05212ca5a286.png)

And here is the error message.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/f/d/fdf4ebac4701354c145f2ea80b3589c2d13cef16.png)  
(Sorry for Japanese, it says that an unhandled error has occurred inside Psychopy.)  
"  
Traceback (most recent call last):  
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 1339, in onPavloviaRun  
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/app/builder/builder.py”, line 759, in fileExport  
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 73, in generateScript  
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 242, in compileScript  
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/scripts/psyexpCompile.py”, line 214, in \_makeTarget  
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/\_experiment.py”, line 266, in writeScript  
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/routine.py”, line 340, in writeEachFrameCodeJS  
File “/Applications/PsychoPy.app/Contents/Resources/lib/python3.6/psychopy/experiment/components/keyboard/ **init**.py”, line 314, in writeFrameCodeJS  
psychopy.experiment.utils.CodeGenerationException: Variables for allowKeys aren’t supported for JS yet: "

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [June 19, 2021, 6:51am UTC](https://discourse.psychopy.org/t/i-cannot-translate-the-script-into-js-in-psychopy-builder/23640/2 "2021-06-19T06:51:59Z")

</div>

> [@11133](#):
>
> Variables for allowKeys aren’t supported for JS yet:

The most important bit of this type of error message is usually at the bottom.

Have you used a variable in the allowed keys field of a keyboard component?

---

<div class="post-metadata">

**Author:** ![11133](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/11133/32/16606_2.png) [@11133](https://discourse.psychopy.org/u/11133)\
**Post date:** [June 19, 2021, 1:29pm UTC](https://discourse.psychopy.org/t/i-cannot-translate-the-script-into-js-in-psychopy-builder/23640/3 "2021-06-19T13:29:40Z")

</div>

I appreciate your support. The error disappears now.

But, unfortunately, another problem occurs.  
I managed to make my new project and jumped to the browser to run the program.

 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/4/9/49e701e4e2699571cd8cabf2eab08a157c36da29.png)  
 ![スクリーンショット 2021-06-19 22.22.20](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/3/5/354b85a94128285d8058b821f7bc3f2995b747ce.png)  
 ![image](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/7/1/7193bbacfbe8e4815b2976025b27b67301932e2e.png)

The followed screen appeared and so I clicked the experiment page, but “no information” message appeared. I surely made my project and Psychopy said Sucess! Do you know what would happen?

Sorry for asking different question in a row.

---

<div class="post-metadata">

**Author:** ![wakecarter](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/wakecarter/32/5753_2.png) [@wakecarter](https://discourse.psychopy.org/u/wakecarter)\
**Post date:** [June 19, 2021, 6:07pm UTC](https://discourse.psychopy.org/t/i-cannot-translate-the-script-into-js-in-psychopy-builder/23640/4 "2021-06-19T18:07:43Z")

</div>

I think that Pavlovia gets confused with usernames that are just digits.

---

<div class="post-metadata">

**Author:** ![11133](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/11133/32/16606_2.png) [@11133](https://discourse.psychopy.org/u/11133)\
**Post date:** [June 20, 2021, 5:37am UTC](https://discourse.psychopy.org/t/i-cannot-translate-the-script-into-js-in-psychopy-builder/23640/5 "2021-06-20T05:37:47Z")

</div>

Thank you so much. After I enter Pavlovia with another account, the program worked well! 😀
