Troubleshooting
Common issues and solutions when using Superflag in React Native and Expo.App Crashes in Production
Symptom
App works fine in development but crashes immediately on launch in TestFlight or production builds.Solution
Quick checklist:- Using public key (
pub_*), not SDK key? - AsyncStorage installed?
- Built with a production build locally?
AsyncStorage Not Found
Symptom
Solution
Install AsyncStorage:Flags Not Loading
Symptom
useFlags() shows status: 'loading' forever, or status: 'error'.
Solution
- Check Client Key
- Check Network
- Check Environment Variables
Ensure you’re using a valid public client key (Common issues:
pub_*):- Using wrong key (SDK key instead of public key)
- Environment variable not set
- Typo in key
Rate Limited
Symptom
status: 'rate-limited' or error message “Monthly quota exceeded”.
Solution
You’ve hit your plan’s monthly request limit. The SDK will continue using cached flags. To resolve:-
Increase cache TTL to reduce requests:
- Upgrade your plan in the dashboard
-
Check for request loops:
Slow Initial Load
Symptom
App shows loading state for several seconds on first launch.Solution
This is expected on first launch. The SDK fetches flags and caches them. Subsequent launches are instant. To improve first launch:-
Show cached content while loading:
-
Preload flags before mounting:
TypeScript Errors
Symptom
TypeScript can’t find types or shows errors for SDK exports.Solution
The SDK includes types out of the box. If you’re getting errors:-
Ensure you’re on TypeScript 5.0+:
-
Add to
tsconfig.json: -
Restart TypeScript server in VS Code:
- Cmd+Shift+P → “TypeScript: Restart TS Server”
Cache Not Persisting
Symptom
Flags reload from network every time app launches, even when cache should be valid.Solution
Check AsyncStorage is working:- Reinstall:
npx expo install @react-native-async-storage/async-storage - For bare RN:
cd ios && pod install - Clear build cache:
npx expo start --clear
Expo Updates ErrorRecovery Crash
Symptom
Crash log showsErrorRecovery.notify or mentions expo-updates.
Solution
This means expo-updates detected an error during app startup and crashed to prevent a bad update from “bricking” your app.Still Having Issues?
If none of these solutions work:- Check the example app in the GitHub repo
-
Enable debug logging:
-
Test with a minimal reproduction: