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
In production Release failed - env variable not importing #38
Comments
What is the error? What does your |
If this is your project https://github.com/2manoj1/breactnative/blob/master/babel.config.js , make sure to add the module to your list of babel plugins https://github.com/goatandsheep/react-native-dotenv/wiki/Migration-Guide#2 |
@goatandsheep Its my config. Its running development mode but in production build its failed. |
Related to tusbar/babel-plugin-dotenv-import#164 |
@goatandsheep Same for me, all production builds failed |
@oleksandr-dziuban Dirty workaround to fix failed builds in my case was to set
|
@AndriyF do you think |
@goatandsheep there are no restrictions set by default, so, I think, for the sake for consistency it's better to have |
I've changed the default for |
@goatandsheep check this. In code two dotenv config. can you check this. |
@2manoj1 Thank you but I don't think that is it. The |
No. In Dev build it was worked as expected. |
I think I know what the issue is. I'll address it this weekend. As you pointed out, the multi-env code is not fully working yet. |
for those that has empty variables in release builds. just change ur env like this --> from to |
@BurakKartal1 huh. that's interesting. I wonder why that works. Should the library cast the values to strings? |
I am having same issue on 0.63.2 any update on this? |
I'm having the same problem (react-native is 0.63.2), but nothing of the above worked for me. I can build in debug, but not in production. |
@2manoj1 Can you try again with the new release and let me know if that works? |
@goatandsheep I have tested on 2.4.0 and it seems to have not solved the issue for me. |
@MrtYlnzz thank you for checking |
Hi there, thanks for supporting this package.
I'm using: node v10.20.1 Looking forward for a fix =) |
Hi there, thank you for this amazing package :) I'm having this issue too, in development mode it works perfectly but it fails in release mode (i'm using xCode)... I changed in my I'm using: |
Hi, any news on this issue? xCode build get error "react-native": "0.63.2", |
If I move |
today i have issue, react native 0.63.3, dotenv 2.5.3, |
Hi @ivanichi this library is not checking for I'd also recommend if there are missing values that you clear the cache: |
@goatandsheep will there be a fix so we don't need to copy the .env files to the ios folder? |
Hm...do you think this is a simple path fix? I'm not having this issue on my end, so I will not release until fully tested, but can you test the following branch? "devDependencies": {
"react-native-dotenv": "git+https://git@github.com/goatandsheep/react-native-dotenv.git#bugfix/gh-38"
} |
@goatandsheep thank you for your suggestions and reply, I will try to explore, if successful i will come back, if on my case doesn't work I'll be happy to contact via the link above |
now
and build again, the problem has been resolved react native 0.63.3 dotenv 2.5.3 |
I'm happy it works for you! Please leave a tip if possible https://issuehunt.io/r/goatandsheep/react-native-dotenv/issues/38 I wish cache cleaning were easier. Maybe this? https://www.npmjs.com/package/react-native-clean-project |
of course with pleasure. I want to send a donation via paypal. please give me your paypal email, thank you. |
we've had the issue of needing to restart the computer when changing values in the does anyone know why you have to restart the computer? |
It's a caching issue. I'll be doing a bit of maintenance tomorrow 😊 |
@gabrieljoelc yes, it should be clean. and you need a cup of coffee for a bit. so need a restart. |
@ivanichi thanks. Yes the restarts have consistently worked but it's pretty painful when switching between environments for test and prod builds |
I'm able to get this working reliably by having two |
The solution is now to install https://www.npmjs.com/package/react-native-clean-project and clean using that. No more restarts. |
@alizahid doh! i'm on an old version that doesn't have those niceties. I'll bump in the next version of the app @goatandsheep what's the Edit: nvm, I just ran |
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. |
I have tried this on React Native v0.70.3 and it is not working.
I have tried all the solutions above and none of them work. I am considering to use another .env package. |
Hi @brianwachira , I'm happy to help but what is the issue? What platform are you building to? Have you created your release / dev profiles on xcode/AS? Is this part of this ticket? This one has been closed for some time and probably should have been locked |
Hi @goatandsheep , I am building to Android. So it turns out that the reason my |
Hi, there, I'm having an issue with my variables, showing as undefined.
Currently using Node 18.12.0 and NPM 8.19.2 |
Try |
No Luck so far. I've tried clearing all the node modules and removing cache. I've also set api.cache(false).. It's not having it :( |
Somehow I fixed it.. For me this worked..
|
I have the same issue. |
On Production build ios React Native 0.63.2 build failed. From
@env
variable not importing.The text was updated successfully, but these errors were encountered: