Help on static assets

I cloned the master repo and created a Docker Compose file with LMS, CMS, Redis, Memcached, and Elasticsearch containers.

I managed to complete:

  • LMS and CMS migrations (including --database=student_module_history).
  • npm install and npm run build-dev (as npm run build caused Docker to freeze).
  • make pull_translations.

While running collectstatic for LMS, I encountered “not a directory” errors for support, teams, course_bookmarks, course_experience, learner_profile, and discussion. After renaming/removing them, collectstatic worked.

However, I received a webpack-stats.json not found error, so I manually copied the file using:

cp ./test_root/staticfiles/webpack-stats.json /edx/var/edxapp/staticfiles/

Several other files also required manual copying, though this shouldn’t be necessary. These are the commands I ran:

rm -rf common/static/edx-ui-toolkit/js
cp -r /edx/app/edxapp/edx-platform/node_modules/edx-ui-toolkit/src/js common/static/edx-ui-toolkit

rm -rf /edx/var/edxapp/staticfiles/edx-ui-toolkit/js
cp -r /edx/app/edxapp/edx-platform/node_modules/edx-ui-toolkit/src/js /edx/var/edxapp/staticfiles/edx-ui-toolkit/

rm -rf /edx/var/edxapp/staticfiles/templates
mkdir -p common/static/templates/student_account
mkdir -p /edx/var/edxapp/staticfiles/templates/student_account
mkdir -p common/static/templates/fields

cp -r ./lms/templates/student_account/* common/static/templates/student_account/
cp -r ./lms/templates/student_account/* /edx/var/edxapp/staticfiles/templates/student_account/
cp -r ./lms/templates/fields/* common/static/templates/fields

I then ran cms collectstatic, which succeeded, but I had to:

cp ./test_root/staticfiles/studio/webpack-stats.json /edx/var/edxapp/staticfiles/studio

Additionally, I made further changes to the CMS container:

rm -rf /edx/var/edxapp/staticfiles/studio/edx-ui-toolkit/js
cp -r /edx/app/edxapp/edx-platform/node_modules/edx-ui-toolkit/src/js /edx/var/edxapp/staticfiles/studio/edx-ui-toolkit

rm -rf ./cms/static/edx-ui-toolkit
mkdir -p cms/static/edx-ui-toolkit/js 
cp -r /edx/app/edxapp/edx-platform/node_modules/edx-ui-toolkit/src/js/* cms/static/edx-ui-toolkit/js/

Pages that are working:

  1. LMS Dashboard
  2. LMS Discover Courses
  3. Profile Page
  4. Account Page
  5. Sign-up/Registration (LMS and CMS)
  6. Sign-in (LMS and CMS)
  7. Studio Home
  8. Course Addition
  9. LMS Admin (Super User)
  10. CMS Admin (Super User)

However, in course authoring, I’m still encountering “file not found” errors and symbolic linking issues, even though the paths seem correct.

I know that I shouldn’t have to correct these paths repeatedly.

Can anyone help? Can someone point out where I might be going wrong?

Note: I don’t want to use Tutor, as my senior on the development team prefers not to.

Hi @Crazy_Geeks and welcome!

I’m not a site operator so I can’t help you, but reading your post I think it would be useful to others who might be able to help if you could include what version of the code you’re running. Are you using Redwood?

I’ll also mention that Tutor is the community-supported deployment environment. I don’t know if you’ll get a ton of help if you’re not using Tutor, but I may be wrong!

Hi @sarina

Thanks for your response!

I’m currently using the master branch of the Open edX platform, which is not tied to a named release like Redwood. The version I’m working with is 4.2.16. I understand that Tutor is the community-supported deployment method, but we’ve decided not to use it due to team preferences. I’m hoping to troubleshoot issues related to static assets and other configurations without Tutor.

Thanks again for your help!