Open brentvatne opened 1 month ago
babel-plugin-transform-inline-environment-variables
also seems to cause the issue
I am having this same issue... is there an react-native-dotenv
alternative we can use to read a .env file?
I am having this same issue... is there an
react-native-dotenv
alternative we can use to read a .env file?
I converted to the built-in system following this guide, with this caveat from the docs:
Do not store sensitive info, such as private keys, in EXPOPUBLIC variables. These variables will be visible in plain-text in your compiled application.
I'm still pondering a good solution for private keys in our solution, but the standard convention works for most of our variables in the meantime.
Minimal reproducible example
https://github.com/brentvatne/repro-dotenv
What platform(s) does this occur on?
Android, iOS, Web
Did you reproduce this issue in a development build?
Yes
Summary
The problem: when you use react-native-dotenv in an app with expo-router, the react-native-dotenv babel plugin will clobber all of the expo-router env vars and inject an env var that is normally only set for the sake of type generation.
The result is that Expo CLI can't find the
app
directory containing your routes, and you see a "Welcome to Expo" screen inviting you to get started. More detailed analysis from @byCedric:Environment
Expo Doctor Diagnostics