Downloading project from git with JS in builder

Description of the problem:
I having a project with working JS code online, but when I download it the builder doesn’t show any JS code.
Is there a way to download the project so it shows JS code in the builder or an easy way to copy the JS code into the builder?

Did you write it in JS directly.

I think you will need to rebuild it but you could copy and paste into code components as necessary (except that you would then have something that only works online because the auto translate only goes Python to JavaScript and not vice versa.

The download shows the python.
When coding the experiment I used the auto translate but had to make some adjustments to the JS.

I think that if you make further changes in Builder then any direct JS changes will be lost and need to be redone. What did you need that couldn’t be done in a code component? I should probably start cataloging such use cases for my crib sheet

I’m not sure what you mean. I don’t think I changed anything after fixing the issues with the auto-translate.

You mentioned copy and pasting, I thought the .js file splits up the code blocks so you can’t just copy-paste from it. Is there another way to do this?

Here is the link to my experiment:

Sorry I think I misunderstood your issue.

Are you experiencing code blocks defaulting to Python when you download the experiment file? I’ve found that on some code blocks when receiving a file from someone else and have wondered whether it was due to them using a different version or because I have a patch which remembers the code type and they don’t.

I didn’t have a problem when syncing so do you have multiple people working on the file? I’m pretty sure my JS both and code_JS blocks were fine when they downloaded my version of the file.

My code_JS block is blank.


I am the only person who has worked on this project.

It says I am running PsychoPy(2020.1.3) which is ahead of the latest official version, could this be the issue?

2020.1.3 is the current version

Your screenshot is of the Each Frame tab. How about Begin Experiment ?

All tabs are blank.

What did you do in between adding the lines to code_JS and them disappearing?

I can only see one code component in your routine and that doesn’t look like the first routine in your experiment.

That is the only code bock in this experiment.

About a month ago I finished working on a project that included this experiment and several others, all uploaded to Pavlovia. This week I needed to make some changes, 13/17 of the experiments were perfectly fine. Three experiments desynched from git (local root got lost, IDK a ton about git) without anyone else modifying the experiment. These were easy to resynch. This project also desynched, but in addition, all the JS was deleted from the code block.
I also tried downloading from git and creating a separate project, but the JS in the code block still doesn’t show up.

Also an important note, I downloaded the working project from git and re-uploaded it to Pavlova as a different experiment and it no longer works.

The project I shared is the re-uploaded one that doesn’t work.
The working old version is:

If you download the psyexp file from the working version and then save it over the non working syncing version then you should be able to sync a working file

Right that was my idea, but the downloaded psyexp from the working version doesn’t show the JS in the code block.
Only other thing of note is that the default code type is Auto->JS.

The default is auto but a JS or Both code block doesn’t lose its JavaScript unless you click on the Python side of the code component.

You might be able to retrieve the code by downam earlier version from Gitlab

Earlier versions are also missing the JS.

You said that they worked. Maybe I’m getting confused here. Do they have Python code? If so then you can switch to auto to create the first draft of the JS code. You’ll need to add a code_ JS component manually as per my crib sheet

Sorry, if I download earlier versions they are also missing the JS.
However the experiment runs online so the JS exists, I just am not able to see it/download it.

Is a code_JS component different from a regular code component? Or is it just the JS code type on a regular code component.