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
This is not an issue as much as a support question. But I couldn't find another forum.
My environment variables are not being replaced when running the following in my universal reactapp:
constenvify=require('envify/custom');// function declarations etcbrowserify().transform(babelify.configure({ignore: [/(bower_components)|(node_modules)/]})).transform(envify(process.env)).bundle().on('error',handleError).pipe(source('app.js')).pipe(buffer()).pipe(gulpif(globalSettings.production,stripDebug())).pipe(gulpif(globalSettings.production,uglify())).pipe(gulp.dest(taskSettings.scripts.dest));
It works locally, but not in my staging environment where the server shows the correct stuff based on env, but is then being replaced by client hydration.
The devil is in the details. As I said in my question, the problem only occurred on my staging (and probably prod) server. So after a while I came across app.json, a Heroku settings file, partly responsible for sending setting which environment variables should be set.
So adding "FEATURE_EXAMPLE": { "required": false} in "env": {} in my app.json fixed the problem.
I'm still curious about why I still see the variable in my dist folder instead of it being replaced.
This is not an issue as much as a support question. But I couldn't find another forum.
My environment variables are not being replaced when running the following in my universal reactapp:
It works locally, but not in my staging environment where the server shows the correct stuff based on env, but is then being replaced by client hydration.
I've described my problem in more detail in this StackOverflow question: https://stackoverflow.com/questions/55594832/envify-not-replacing-my-environment-variables
Grateful for any help!
The text was updated successfully, but these errors were encountered: