You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I set some environment variable to process.env in the browser process, then start the renderer process, but I can not get the environment variable I have set on the renderer process.
I tested this on windows and mac, they worked!
Since my app rely on this environment passing to the renderer process, it would be great if the behaviors are the same across different platforms.
I am trying to use process.env.TZ = 'America/Managua'; in my app
if I give that in main process it is working fine, if I give that in render process no effect.
is there any way to achieve this.
I just need to change the time zone for every request.
Activity
MarshallOfSound commentedon Apr 20, 2016
Seems a bit strange to use environment variables for communication between processes 👍
But as a temporary workaround you might be able to use
remote.getGlobal('process').env
.zcbenz commentedon Apr 20, 2016
This is unfortunately an expected behavior and we are not able to fix it, you can find more about it in #3306.
myfrndjk commentedon Apr 9, 2017
Hi,
I am trying to use
process.env.TZ = 'America/Managua';
in my appif I give that in main process it is working fine, if I give that in render process no effect.
is there any way to achieve this.
I just need to change the time zone for every request.
dcsw commentedon Sep 27, 2017
In the rendering process, try using the following:
const electron = window.require('electron'); const remote = electron.remote; //... console.log(remote.process.env["TZ"]);
Change "TZ" to get other environment variable values.
myfrndjk commentedon Sep 28, 2017
@dcsw : Thanks for the update.
Already @MarshallOfSound has clarified this #9150
ryancwalsh commentedon Dec 10, 2023
Maybe this is outdated. I get
Property 'remote' does not exist on type 'typeof CrossProcessExports'. ts(2339)