-
-
Notifications
You must be signed in to change notification settings - Fork 51
Description
- Asked question in discussions
- [X ] Tried the troubleshooting Wiki
- [X ] Followed the migration Wiki
- [X ] Installed library as devDependency not production dependency
Describe the bug
I have a fully working app on react-native that works on both web and mobile. I am trying to shift away from using hard-coded api urls and put them all into a .env file. When I added react-native-dotenv my program runs just fine, but all the env variables are being returned as undefined.
To Reproduce
Steps to reproduce the behavior:
- npx expo install react-native-dotenv
- create .env file
- import variables from @env
- variables print out as undefined :(
Expected behavior
I expected it to return my url string or atleast give an error
Screenshots
Desktop (please complete the following information):
- OS: [Linux Mint 22 and Windows 10]
- Browser [Firefox]
- Version [I don't know]
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
The example expo project you posted works, but my program doesn't work... I don't understand why. The only difference is that the example project uses webpack while I rely on just expo to build my web version.



