How to run tutor-mfe: course-authoring in dev mode using npm run dev

Hello everyone,

I have been successfully able to mount the tutor-mfe course-autoring to my local tutor setup. It works fine, my changes are being reflected. Currently, here’s what I do:

  1. Make changes to my cloned course-authoring repo.
  2. Re-mount the course-authoring repo
  3. run tutor dev launch

Obviously, this works but the problem is that this is too slow for development. So instead here is what I am trying:

  1. run tutor dev launch
  2. run tutor dev stop course-authoring to stop the course-authoring container
  3. run npm run dev after going into the course-authoring repo’s root folder. (This also runs without errors)

The host name is local.openedx.io. Both, the tutor containers and course-authoring locally, are running on the same hostname. All MFEs running in the tutor container are running but I am unable to access the studio which is running locally.

My best guess is that this has something to do with the name being changed from course-authoring to authoring.

Any help would be appreciated. Happy to give any logs if required.

Hey @Suleman_Hamdani

You can have a look at this PR

here we are trying to run learning MFE, the only change required in the above PR is just to use APP_ID='course-authoring'

Let me know if you have any doubts.

Thank you for your reply, Farhaan.

I made the following changes:

  • APP_ID='course-authoring' in .env, .env.test, .env.test

  • Then I also made this change in package.json:

FROM:
"dev": "PUBLIC_PATH=/authoring/ MFE_CONFIG_API_URL='http://localhost:8000/api/mfe_config/v1' fedx-scripts webpack-dev-server --progress --host apps.local.openedx.io",

TO:
"dev": "PUBLIC_PATH=/course-authoring/ MFE_CONFIG_API_URL='http://localhost:8000/api/mfe_config/v1' fedx-scripts webpack-dev-server --progress --host apps.local.openedx.io",

It wasn’t able to load studio home which made me wander to the links in .env.development and .env.test

I noticed that there are a lot of URLs which say localhost:xxxx. I changed the STUDIO_BASE_URL here to studio.local.openedx.io:8001 and voila, it worked! It at least shows me the studio home. When I click on a course, I get login refresh error which I am guessing has something to do with REFRESH_ACCESS_TOKEN_ENDPOINT url in .env.development

Here’s my question now:
There are a lot of URLs in the .env like BASE_URL, LOGIN_URL, LEARNING_BASE_URL. Do I have to change these to the ones running on my tutor? How do I figure these URLs out? Thanks a lot.

@Suleman_Hamdani Did you do this in addition to the above steps?

tutor dev stop

tutor config save --set LMS_HOST=local.openedx.io --set CMS_HOST=studio.local.openedx.io
 
tutor dev launch -I --skip-build

tutor dev stop learning 

Yes, I did this at the beginning.

@farhaanbukhsh This worked! I believe my sign in had expired. Once I logged in, it worked. Thanks a lot!!! :smiley: