Description
Describe the bug
The environmental variables defined in .env
file cannot be used in .env.development
and .env.production
files.
Steps to reproduce
- define .env variable:
PORT=4000
- define .env.development variable:
REACT_APP_URL=http://localhost:${PORT}
- Add code showing the value
console.log(process.env.REACT_APP_URL);
- 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".