.env.* files are not picking up in create-react-app

Viewed 868

in my reactjs app, which has been created with creat-react-app, I've created these files

  • .env
  • .env.developmnet
  • .env.development.local

which contains REACT_APP_END_POINT=localhost:3001

the problem is when I run npm start the process.env.REACT_APP_END_POINT is undefined, but if I run the command like REACT_APP_END_POINT=localhost:3001 npm start, everything is fine. here is the versions for related packages:

  • "react": "^16.13.1"
  • "react-scripts": "3.4.1"
1 Answers

Please make sure your .env place as the same level with src and 'package.json'

Related