We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Yes I just installed Node v6.10.3 npm 3.10.10
I have a file .env in the root of a brand new create-react-app that looks like this:
.env
API_HOST=http://localhost:5000
I have added the following to the index.js file:
console.log(process.env)
I do not get anything but the default environment variables logged out:
Expected the API_HOST variable to be available on process.env
process.env
Run these commands in the project folder and fill in their results:
npm ls react-scripts:
npm ls react-scripts
`-- [email protected]
node -v:
node -v
v6.10.3
npm -v:
npm -v
3.10.10
Operating system:
Edition: Windows 10 Enterprise Version: 1607 OS Build: 14393.1198
Browser and version:
Google Chrome Version 58.0.3029.110 (64-bit)
Here is the repo:
https://github.com/sethreidnz/create-react-app-dotenv-repro
The .env file I am using:
https://github.com/sethreidnz/create-react-app-dotenv-repro/blob/master/.env
The place I am trying to use the process.env:
https://github.com/sethreidnz/create-react-app-dotenv-repro/blob/master/src/index.js
This is potentially related to this issue:
#2230
The text was updated successfully, but these errors were encountered:
@sethreidnz It should be REACT_APP_API_HOST Have a look at Adding Custom Environment Variables
Sorry, something went wrong.
Thank you! I did read that part but for some reason didn't think about it in the context of the .env files... Idiot!
No branches or pull requests
Can you reproduce the problem with latest npm?
Yes I just installed Node v6.10.3 npm 3.10.10
Description
I have a file
.env
in the root of a brand new create-react-app that looks like this:I have added the following to the index.js file:
I do not get anything but the default environment variables logged out:
Expected behavior
Expected the API_HOST variable to be available on
process.env
Actual behavior
I do not get anything but the default environment variables logged out:
Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
:`-- [email protected]
node -v
:v6.10.3
npm -v
:3.10.10
Operating system:
Edition: Windows 10 Enterprise
Version: 1607
OS Build: 14393.1198
Browser and version:
Google Chrome
Version 58.0.3029.110 (64-bit)
Reproducible Demo
Here is the repo:
https://github.com/sethreidnz/create-react-app-dotenv-repro
The .env file I am using:
https://github.com/sethreidnz/create-react-app-dotenv-repro/blob/master/.env
The place I am trying to use the
process.env
:https://github.com/sethreidnz/create-react-app-dotenv-repro/blob/master/src/index.js
This is potentially related to this issue:
#2230
The text was updated successfully, but these errors were encountered: