Uncaught ReferenceError: log4javascript is not defined

Description of the problem: Hi everyone,
The experiment worked fine when I used PsychoPy builder on my computer. However, when I put it online, it was stuck on “initialing the experiment” in the pilot mode. I checked the “Developer Tools - Console” and found

“Uncaught ReferenceError: log4javascript is not defined
at new PsychoJS (/Danielle829/si_exp/lib/core-2021.1.2.js:1603:45)
at /Danielle829/si_exp/Experiment.js:17:18”
as shown below:

When I clicked the link, line 1603 from core-2021.1.2.js showed:


and line 17 from Experiment.js showed:
“const psychoJS = new PsychoJS({”

I’m new to Python, JS, and PsychoPy and I’m confused about what I can do for debugging. It seems to me that this error occurs earlier than loading the first code block. Any ideas on how to fix this error? Thank you!

这个显示应该是加载资源的设置出了问题

感谢您的回复,那请问加载资源要怎么设置比较好呢?我完全不懂这个…我需要自己下载并配置log4js包吗?

首先,程序初始化时是否能够正常加载文件如csv,py等

你需要给我展示一下你的文件结构是否齐全

哦哦好的,我不太确定文件结构是什么意思,是指的实验中所引用的材料吗?再一次感谢您的回复!


您好,这是我上传实验时,打包的文件夹的截图,不知道这个可以看出文件结构吗?
(Hi, Wen! This picture shows all the documents that I have uploaded online. )

Dear @Danielle,

I have just had a look and it appears that you have updated your experiment, which is now running without issue, as far as I can tell. I believe that all is well, then?

Incidentally, it would be best if you could keep public conversations to English. That makes it possible for everyone to read your messages, potentially help you, and potentially benefit from the help that you got.
Thank you very much!

Alain

Dear @apitiot,

Thanks for your message! I’ve updated my Psychopy version from 1.2 to 2.3, and the same error didn’t occur again. Maybe updating to the latest version can be helpful.

Later, I also encountered several issues such as “.download Resources() is not a function” and “unknown resource”. Then I added my files into “Edit experiment settings” - “online” - “additional resources”, and these issues were solved. Now my experiment is running and I finally got time to update this post. Apologies for my late reply.

Best wishes,
Danielle

That is no problem at all. I am very glad that all was well in the end.
Best wishes,

Alain