jvente
(Jhon Venté)
August 19, 2023, 12:28am
1
Hi guys! How can we add a .env
variable that doesn’t exits or re write one to an mfe since tutor which means for example I want to add this variable
MY_CUSTOM_VARIABLE=true
I’ve tried to do it as the doc but didn’t work for me I did something like below
from tutor import hooks
hooks.Filters.ENV_PATCHES.add_items(
[
(
"mfe-lms-development-settings",
"""
MFE_CONFIG["MY_CUSTOM_VARIABLE"] = True
"""
),
(
"mfe-lms-production-settings",
"""
MFE_CONFIG["MY_CUSTOM_VARIABLE"] = True
"""
)
]
)
Any help will really appreciate, thanks!
regis
(Régis Behmo )
August 28, 2023, 9:44am
2
Your plugin should work.
jvente:
but didn’t work for me
Can you describe more precisely what failed?
jvente
(Jhon Venté)
August 28, 2023, 1:38pm
3
Hi @regis !
When I go inside a Docker container of a any mfe the variable is not in .env
files that is the problem
regis
(Régis Behmo )
August 28, 2023, 1:57pm
4
As of Palm and runtime configuration, microfrontends no longer use environment variables for configuration. Instead, configuration is pulled from the LMS at runtime. This makes it possible to build MFE images once and for all users.
sambapete
(Pierre Mailhot)
August 28, 2023, 2:15pm
5
@regis I beg to differ.
I encountered a similar problem here
I had never noticed it before earlier this week, but Order History in Olive or Palm seems to be broken.
[Capture d’écran, le 2023-07-06 à 10.37.11]
As you can see from the screenshot, it does not seem to work and the page keeps on trying to load.
I am not a Javascript or React specialist, but the developers console seems to indicate that properties for map are undefined after trying to access ORDER_HISTORY__FETCH_ORDERS.
Looking at the code from Nutmeg where it was still working and the c…
The only way I was able to pass the proper values to the frontend-app-ecommerce MFE was to set these values in a fork and in the .env file for that MFE.
regis
(Régis Behmo )
August 28, 2023, 2:34pm
6
OK then let’s just say in most cases environment variables will be ignored
1 Like