Open AnshulRaghav opened 2 months ago
Hey, thank you for opening this issue! 🙂 To boost priority on this issue and support open source please tip the team at https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/508
Same issue here
While starting the server, via yarn, add "--reset-cache" to clear the cache. This helped me in getting the correct env.
My use case: I have two different .env files - One for development and one for production. I have two scripts to start the RN server each with different env file but it was taking always taking with the one I started.
Reseting the cache while starting the server helped me.
The full command:
yarn start --reset-cache
or,
yarn start:prod --reset-cache
package.json scripts:
{ ... "start": "APP_ENV=dev react-native start", "start:prod": "APP_ENV=prod react-native start", ... }
Env files: .env.dev .env.prod
Describe the bug Suddenly the values in .env files are not getting updated. It was working fine earlier. I'm using
gulp
to change between multiple environments.package.json
babel.config.js
Simulator: iphone 15, ios 17.4
I've tried various methods:
Even deleted .env file but it doesn't seem to have any impact and was working fine.