Heroku Process.env Not Showing Config Vars
I have a react app in a Heroku pipeline. Simply staging -> production. In staging => Settings I have some config vars set up for the environment. However, when I console.lo
Solution 1:
I am using the following buildpack: https://github.com/mars/create-react-app-buildpack.git
Apparently you MUST name the config vars starting with REACT_APP_
and then you can access them via process.env
.
This is all clearly outlined in the buildpack's documentation. I was just too dumb to actually check there :/
Solution 2:
Append your Config Var name with the string 'React_App_' at the beginning (like React_App_Var_Name) and use this name in your ReactJs app. If this string is not appended and used, then it will return undefined.
For deploying production build, follow the steps mentioned in this link.
Post a Comment for "Heroku Process.env Not Showing Config Vars"