hughsk / hughsk/envify

Can't get environment variables to replace

Open
#61 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
895
Forks
57
PR merge metrics
No merged PRs in 30d

Description

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:

```Javascript
const envify = require('envify/custom');

// function declarations etc
browserify()
.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.

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!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.