New issue
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
APP_ENV doesn't work as expected #131
Comments
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/131 |
I wonder if this is a caching issue. Try this for now https://www.npmjs.com/package/react-native-clean-project |
@goatandsheep unfortunately no change |
This looks exactly like the stuff in the multi env wiki. Let me know if that helps |
It doesn't really help actually. As far as I can see I can't have the flexibility as I wrote above. |
One thing I can say is that gradlew is not react native so |
btw, you shouldn't need |
The problem I ran into using As I understand That is all good if you have the ability to spawn a custom packager, e.g.: in debug builds. But what happens when you run a release build? If Am I missing something or do you experience the same? I managed to bypass this whole |
I'm having the same problem. When I try to build a release version with |
I figured out the issue while doing some experimentation, but I'm going to write some documentation on it this weekend |
Hey! 👋 I noticed that you are passing the I suggest changing your {
"scripts": {
"start": "APP_ENV=development react-native start --reset-cache",
"start-prod": "APP_ENV=production react-native start --reset-cache"
}
} It is important to note that your Hope that helps! |
@caiangums Thanks for the motivation to help. I think all of us read the documentation, and we all provided the I ended up using react-native-config because of the following reasons:
Anyway, thanks @goatandsheep for your work and your kindly responses, I just found that the other package better suits my needs. |
@f4z3k4s Thanks for the clarification! I used While trying to change some code at |
I need to figure out how the other library deals with caching issues |
I have same issue, hope to receive a solution from you soon @goatandsheep :D |
If you're using This has been added to the README. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Hey , i'm also experiencing the same issue. Has anyone found a solution for this problem? |
Hi @Asranov! Turns out that I changed my approach to other libs for solving this issue. If you want, you can try the approach mentioned by @f4z3k4s using react-native-config. |
I want to be able to use
development
andproduction
config files according to the APP_ENV variable I pass.But even if I pass the env as a variable, it uses
development
for debug andproduction
for release.The text was updated successfully, but these errors were encountered: