Skip to content

.env vars empty in .env.development #11954

Description

@pinggi

Describe the bug

The environmental variables defined in .env file cannot be used in .env.development and .env.production files.

Steps to reproduce

  1. define .env variable:
PORT=4000
  1. define .env.development variable:
REACT_APP_URL=http://localhost:${PORT}
  1. Add code showing the value
console.log(process.env.REACT_APP_URL);
  1. Run the app and see the value

The result is: "http://localhost:" - the port is missing.

If the port is defined in the same file .env.development:

PORT=4000
REACT_APP_URL=http://localhost:${PORT}

Then the result is correct: "http://localhost:4000".

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions