This repository was archived by the owner on Jun 11, 2022. It is now read-only.
This repository was archived by the owner on Jun 11, 2022. It is now read-only.
Need to Re-deploy after setting Env Vars #178
Closed
Description
Hi, thanks for this great buildpack. It has really made deploying react apps much easier!
However, I am experiencing some behavior possibly related to this issue, where a re-deploy is required AFTER setting REACT_APP_
env vars in order for them to be recognized on Heroku.
Steps to reproduce:
- Add some code to your react app which references and prints an env var, like
var API_URL = process.env.REACT_APP_API_URL || "http://localhost:5000"
. - Then commit and deploy the code to heroku via
git push heroku master
. - Then set the env var via
heroku config:set REACT_APP_API_URL="my-api-url"
- When you visit the site, you'll see it not recognize the env var.
After re-deploying again AFTER setting the env var, you'll see it works.
Desired behavior:
When I set an env var on Heroku, perhaps the build should be re-triggered or something, so a re-deploy is not necessary.
Version:
I believe I'm using the most recent version of this buildpack, but not sure how to check. This is the output from heroku buildpacks:versions mars/create-react-app
:
Version Released At Status
─────── ──────────────────────── ─────────
7 2019-03-11T14:43:39.712Z published
6 2018-12-23T16:31:59.674Z published
5 2018-10-08T20:48:34.131Z published
4 2018-10-02T16:59:42.585Z published
3 2018-09-23T20:00:49.383Z published
2 2018-09-11T18:31:36.419Z published
1 2018-05-30T18:32:49.395Z published
Metadata
Metadata
Assignees
Labels
No labels