react-native-dotenv doesn't work with EAS builds
Asked Answered
R

2

1

We used dotenv lib with classic builds and it worked fine providing a possibility to manage different environments. But it stopped working when we moved to EAS builds.

What are possible solutions?

Remount answered 4/10, 2022 at 11:47 Comment(0)
R
1

I tried to replace dotenv with a combination of direnv tool and EAS secrets but then I accidentally found this file in Expo github repo. It seems like creating .easignore file copying .gitignore file excluding env files makes dotenv work with EAS.

Remount answered 4/10, 2022 at 11:47 Comment(0)
V
1

react-native-dotenv maintainer here. Be careful NOT to commit .env to git. This is a major security risk. .env files are in .gitignore for a very good reason. Instead, the EAS documentation says :

To create app-specific secrets, navigate to the "Secrets" tab in your project dashboard.

Vhf answered 18/11, 2022 at 19:12 Comment(1)
No one say here to commit .env files to gitRemount

© 2022 - 2024 — McMap. All rights reserved.