Changed an EXPO_PUBLIC_ variable but the app still uses the old value
ExpoConfirmed fix
Metro
There is no error message for this one, only the symptom in the title.
Cause
EXPO_PUBLIC_* values are inlined into the bundle at transform time and Metro caches transformed files, so a changed .env value is not picked up.
Fix
Restart Metro with the cache cleared:
shell
npx expo start --dev-client --clearWhen exporting an update, also use --clear or the old value can be re-baked.
More Expo errors
- Dev client red screen: No script URL provided (launcher never appears)No script URL provided
- Bundle fails with Invalid expression encountered after supabase-js updateInvalid expression encountered
- After upgrading to SDK 57, expo-font / expo-image / expo-asset config is missing
- SDK upgrade: export dies with SyntaxError after expo install --fixSyntaxError: ... Unable to determine event arguments for "onModeChange"
- expo-doctor wants TypeScript 6 but tsc reports hundreds of errors