I have a Tutor local deployment installed. In the docker container for MFE, I have the learning MFE in the folder /openedx/dist/learning where the React production files are contained after the mfe build. However, when attempting to access a course from the “View Course” button I receive this error:
Error: getLocale called before configuring i18n. Call configure with messages first.
at E (lib.js:151:11)
at p (ErrorPage.jsx:26:40)
at Va (react-dom.production.min.js:153:146)
at bu (react-dom.production.min.js:261:496)
at ds (react-dom.production.min.js:246:265)
at As (react-dom.production.min.js:246:194)
at ns (react-dom.production.min.js:239:172)
at Ju (react-dom.production.min.js:230:137)
at Ls (react-dom.production.min.js:281:43)
at react-dom.production.min.js:284:301
It seems to cause a blank page for all of the MFE applications as attached. I’m not able to say any further issues until we can resolve this blank page issue.
Yes i am getting a blank page too. Could it be related to the domain names. Because i am not using the default domain names. Such as:
My lms domain: lms.mydomain.com
My mfe domain: lmsapps.mydomain.com
Just guessing here:
I had a simlair error when the MFE configuration for LANGUAGE_PREFERENCE_COOKIE_NAME was not set. It’s usually set to openedx-language-preference. You can ensure this the case for when opening development tools and check request/response header which include that cookie or through Application =>Storage => cookies from development tools.
This setting can be set at build time or through Dynamic config api, you can debug that there is a success request to mfe_domain/api/mfe_config/v1?mfe={APP_NAME} that request shall return something like this
Getting the same result from the MFE APIs and it looks like LANGUAGE_PREFERENCE_COOKIE_NAME was set correctly.
Interestingly this issue seems to occur only when we do not use the default proxy settings as Caddy is not listening to 443 and MFE domain is set to something like mfe-lms.xxx.com rather than apps.lms.xxx.com.
Hummm I suppose you probably need to change this config SESSION_COOKIE_DOMAIN this a common problem if your mfe domain is not a subdomain of the lms. So for example if you have lms.mydomain.com and mfe.mydomain.com then SESSION_COOKIE_DOMAIN would need to be set a .mydomain.com as opposite of the default lms.mydomain.com. This settings can be changed through tutor file plugin i.e
save the above as a fiile in tutor plugins printroot assume you call the file cookie.py then the last step to enable it tutor plugins enable cookie. And probably restart the platform would be needed
Yes, the problem solved thank you so much. I applied the patch, and can see the SESSION_COOKIE_DOMAIN setting in lms.env.yml file. But there was another row below with the same key but with the default domain value. So I edited it manually and the problem solved.
I don’t know why my patch didn’t override the setting but i think i can handle the rest.
Thanks for your help.
Hey @ghassan ,
I’ve been recently experiencing the issue above when migrating servers to a more private server with a load balancer.
I had to place a config object in a custom plugin and have tried all the solutions suggested here. However, the error still appears on my course home page.
Any idea why this might be happening and how i can fix it?
UPDATE!
As I am running an external load balancer, I am constantly running Caddy with HTTPS off, which makes the cookies carry the HTTPONLY flag, does anyone know of a way I can stop this?
Just wanted to mention that overriding SESSION_COOKIE_DOMAIN is a dangerous idea, and it will void your warranty. Make sure you know what you are doing.