Build Errors
Module not found / Cannot resolve module
Module not found / Cannot resolve module
Symptoms:Solutions:
-
Clear Metro cache:
-
Check import path:
-
Clear node_modules and reinstall:
-
Check file extension:
-
Watchman issues:
iOS build fails: Pod install errors
iOS build fails: Pod install errors
Symptoms:Solutions:
-
Update CocoaPods:
-
Deintegrate and reinstall:
-
Update pod repo:
-
Clear CocoaPods cache:
-
Check Podfile platform version:
Android build fails: Gradle errors
Android build fails: Gradle errors
Symptoms:Solutions:
-
Clean Gradle:
-
Clear Gradle cache:
-
Update Gradle version:
-
Check Android SDK:
- Open Android Studio
- SDK Manager → Install required SDK versions
- Set ANDROID_HOME environment variable
- Sync project with Gradle files in Android Studio
'React/RCTBridgeModule.h' file not found
'React/RCTBridgeModule.h' file not found
Symptoms:Solutions:
-
Clean and reinstall:
-
Clear Xcode derived data:
-
Clean build folder in Xcode:
- Product → Clean Build Folder (Cmd + Shift + K)
-
Check Header Search Paths in Xcode:
- Build Settings → Header Search Paths
- Should include
$(SRCROOT)/../node_modules/react-native/React
Runtime Errors
Red screen: Invariant Violation
Red screen: Invariant Violation
Symptoms:Solutions:
-
Check component imports:
-
Verify component exports:
- Check for circular dependencies
-
Ensure component is properly defined:
Network request failed
Network request failed
Symptoms:Solutions:
- Check network connectivity
-
Allow HTTP on iOS (development only):
-
Check Android network permissions:
-
Use correct localhost address:
- iOS Simulator:
http://localhost:3000 - Android Emulator:
http://10.0.2.2:3000 - Physical device: Use computer’s IP address
- iOS Simulator:
- Check CORS on backend
-
Verify API endpoint:
White screen on launch
White screen on launch
Symptoms:
- App shows white/blank screen
- No errors in console
-
Check Metro bundler is running:
-
Reload JavaScript:
- iOS: Cmd + R
- Android: Press R twice or Cmd/Ctrl + M → Reload
-
Check App.js/index.js:
-
Check for JavaScript errors:
- Open React Native Debugger
- Check console for errors
-
Verify root component renders:
App crashes on launch (native crash)
App crashes on launch (native crash)
Symptoms:
- App crashes immediately
- No JavaScript error
-
Check native logs:
iOS:
Android:
-
Clean and rebuild:
-
Check native module compatibility:
- Verify all native modules support your React Native version
- Update or remove incompatible modules
-
Reinstall native dependencies:
Performance Issues
Slow navigation / UI lag
Slow navigation / UI lag
High memory usage
High memory usage
Symptoms:
- App crashes with out of memory
- Slow performance over time
-
Optimize images:
-
Clean up listeners and timers:
-
Limit list rendering:
- Use FlatList instead of ScrollView for long lists
- Implement virtualization
- Remove items outside viewport
-
Monitor with Performance Monitor:
- Shake device → Show Performance Monitor
- Watch Memory usage
Metro Bundler Issues
Metro bundler stuck at loading
Metro bundler stuck at loading
Symptoms:Solutions:
-
Reset cache:
-
Clear watchman:
-
Clear Metro cache:
-
Increase Node memory:
- Check for circular dependencies
Port already in use
Port already in use
Symptoms:Solutions:
-
Kill process on port 8081:
macOS/Linux:
Windows:
-
Use different port:
Then run app with custom port:
Debugging Tools
React DevTools not connecting
React DevTools not connecting
Solutions:
-
Ensure React DevTools is running:
- Reload app after opening DevTools
- Check firewall settings
-
Try different port:
Chrome debugger disconnecting
Chrome debugger disconnecting
Solutions:
-
Use Hermes debugger instead:
- Shake device → “Debug with Chrome” becomes “Hermes Debugger”
- Disable Chrome extensions
- Clear Chrome cache
-
Use Flipper instead:
Environment Issues
Command not found: react-native
Command not found: react-native
Solutions:
-
Use npx:
-
Install globally (not recommended):
-
Add to PATH:
Node/npm version issues
Node/npm version issues
Solutions:
-
Check Node version:
-
Update Node using nvm:
-
Clear npm cache:
Testing Issues
Jest tests failing with module errors
Jest tests failing with module errors
Solutions:
-
Configure Jest transform:
-
Mock native modules:
-
Clear Jest cache:
Getting Help
When seeking help:-
Provide error logs:
- Full error message
- Stack trace
- Metro bundler output
-
Share environment info:
-
Create minimal reproduction:
- Isolate the issue
- Share code that reproduces the problem
-
Check existing issues:
- React Native GitHub Issues
- Stack Overflow
- React Native Community
Next Steps
Debugging
Learn debugging techniques
Upgrading
Upgrade React Native safely