Closed t-ricci-enhancers closed 4 years ago
The same issue, have no solution yet.
macOS Catalina 10.15.3 Xcode Version 11.4 (11E146) Node version v12.16.1 Npm version 6.13.4 react-native-dotenv version 0.2.0 react-native version 0.61.4 react version 16.9.0 metro version 0.56.0 @babel/core version 7.8.7
Did you guys try what is suggested in the README... A change in import statement (adding a space or something) makes the changes in the env file picked up.
It worked closing metro-bundler and running it again with the reset cache option: react-native start --reset-cache
instead of react-native start
(or npm start -- --reset-cache
if you have the npm start script in the package.json`)
This is a Bug report.
As stated in the title, for me and other members of my team, changing the contents of the .env and .env.production files require a full reboot of the computer in order to be picked up on the app build.
This is my current specs:
macOS Catalina 10.15.4 (19E266) Xcode Version 11.4 (11E146) Node version v13.10.1 (I'm using Oh-My-Zsh and Node version manager NVM) Npm version 6.14.4 react-native-dotenv version 0.2.0 react-native version 0.61.4 react version 16.9.0 metro version 0.56.3 @babel/core version 7.7.2
I've already tried cleaning the project's folder (and obviously restarting the metro bundler) but it didn't work until I rebooted the mac.
Here's the shell script that I'm using to clean react-native build and cache files: