Discussion MFE not working on master branch

Hi. I’m running openedx palm 2 with tutor 16.1.2 in production. Recently I had to switch the learning MFE to the master branch and all is fine. But when doing the same for the discussions MFE, I get An unexpected error occurred. Please click the button below to refresh the page. error when loading the discussions tab.

I checked for error logs in lms and mfe containers logs but found nothing. In the console though, I get the following error:

Not sure if this is a problem with tutor or the discussions MFE itself. My discussion plugin is as follows:

from tutormfe.hooks import MFE_APPS

def _add_my_mfe(mfes):
    mfes["discussions"] = {
        "repository": "https://github.com/openedx/frontend-app-discussions/",
        "port": 2002,
        "version": "master",
    return mfes

You were lucky. There are great chances that switching to the master branch will not work. Please don’t do that.

I’m first testing it on local. In case of the learning MFE, we needed a lot of the changes that are currently in the master branch and unfortunately we don’t have the time to implement all those on our own at the moment. So what we’re doing is that first we check the state of the MFE in master branch, and if it had solved our problems, we get ideas from those commits or make a custom branch / tag from master after we’ve done enough testing and made sure that it works. From the experience with learning, I have hopes that many of those changes have happened to discussion MFE on the master branch.
Currently I need to see if the master branch (commits after the palm release) of discussions MFE have implemented what we need or not. So I guess the only way for me is to run the master branch in local. Unfortunately the discussions MFE is not in the devstack by default so I can’t check it from there. I tried to add it to devstack on my local but in the provision step, devstack returns some error and as our time is so tight I’m trying to get the master branch of discussions with tutor on local.

If you want to test the latest changes in the Discussions MFE, I suggest you try out the Tutor nightly branch: Running Open edX on the master branch (“nightly”) — Tutor documentation

Thanks. I’ll give this a try. Hope discussions are fine in the nightly branch.

But generally, how can I see the error logs when a MFE displays the page in my first post?

That’s an excellent question. You see, the problem is that microfrontends are just that: frontends. There is no backend code. So pretty much all of the troubleshooting needs to happen in the browser. And the frontend code does not emit logs. So… you don’t use logs to troubleshoot MFEs :-/ I don’t have a much better alternative to suggest, as I’m not a frontend developer myself.

Great :)) So in other words we currently can’t know what’s the problem with the master branch of the discussions MFE, at least not when launched with tutor. Apart from that, I tried running tutor nightly and while pulling images it gives me the Error response from daemon: manifest for overhangio/openedx-mfe:16.1.1-nightly not found: manifest unknown: manifest unknown error.

Yes, we don’t provide nightly images for the mfe image. You need to build it yourself with tutor images build mfe.

So I looked into the DiscussionHome.jsx file that is in the error log and the problem seems to be with this line:

const { params: { page } } = useRouteMatch(`${Routes.COMMENTS.PAGE}?`);

As far as I realised, the useRouteMatch function is returning null. Sorry if I’m wrong, I’m not a frontend developer and I’m just saying my guesses :))

mfe discussion Development

Sorry for the late response. I built the MFE image and after launching tutor, when clicking on the login button I get this page:

The URL of the login button is fine but after the redirect I get the page above.