Skip to content
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
@s2t2

Description

@s2t2

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:

  1. 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".
  2. Then commit and deploy the code to heroku via git push heroku master.
  3. Then set the env var via heroku config:set REACT_APP_API_URL="my-api-url"
  4. 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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions