Common issues and solutions for acp-mobile development.
Symptoms:
TypeError: fetch failed
at fetchWithCredentials
at getNativeModuleVersionsAsync
Cause: Expo CLI tries to fetch version information from Expo's servers, which may fail behind corporate proxies or with network issues.
Solutions:
npm run start:offlineThis bypasses all network checks while still allowing the development server to run.
./start-offline.shCreate .env.local:
EXPO_NO_DOCTOR=1
EXPO_OFFLINE=1Then run normal start:
npm startnpx expo start -c --offlineSolution:
# Find the process
lsof -i:8081
# Kill it
kill -9 <PID>npx expo start --port 8082Solutions:
-
Check if you're in development mode:
- Performance monitoring only works in
__DEV__mode - Run
npm start(notnpm start --no-dev)
- Performance monitoring only works in
-
Access the dashboard:
- Tap the 📊 floating button in bottom-right corner
- Or run
performance.report()in Metro bundler console
-
Verify monitoring is initialized:
- Check Metro bundler logs for:
✅ QueryClient initialized with optimized settings ✅ why-did-you-render initialized 🔍 Performance monitoring active
- Check Metro bundler logs for:
Solution:
# Clean install dependencies
rm -rf node_modules package-lock.json
npm install
# Run type check
npm run type-checkSolutions:
npx expo start -cnpm run reset-project
npm install
npx expo start -cnpm installSolutions:
# Close all simulators
killall Simulator
# Reset specific device
xcrun simctl erase allnpm run ios -- --cleanSolutions:
adb devicesadb reverse tcp:8081 tcp:8081npm run android -- --cleanSolution:
npm run lint:fix
npm run formatnpm run validategit commit --no-verifySolutions:
-
Check performance metrics:
performance.report()
-
Look for specific issues:
- Memory usage > 70%? Check for memory leaks
- FPS < 50? Check for slow components
- Many re-renders? Check component memoization
-
Use the performance dashboard:
- Tap 📊 button
- Find components with high render counts
- Check "Slow Rendering Components" section
Check QueryClient configuration:
The QueryClient should be a singleton:
// ✅ Correct - singleton pattern
let queryClient: QueryClient | null = null
function getQueryClient() { ... }
// ❌ Wrong - recreated on every render
const queryClient = new QueryClient()Verify cache settings:
staleTime: 5 * 60 * 1000, // 5 minutes
gcTime: 10 * 60 * 1000, // 10 minutesSolutions:
-
Check connection status:
- Look for connection indicator in app
- Check for error messages
-
Verify SSE endpoint:
- Check
utils/constants.tsfor API_BASE_URL - Ensure SSE endpoint is accessible
- Check
-
Check console for errors:
- Look for SSE connection errors
- Check for CORS issues
-
Use mock SSE for testing:
- Set
USE_MOCK_SSE = trueinhooks/useRealtimeSession.ts
- Set
-
Check console logs:
- Metro bundler terminal
- Browser console (for web)
- React Native Debugger
-
Enable verbose logging:
EXPO_DEBUG=1 npm start
-
Check performance metrics:
performance.report()
-
Review recent changes:
git log --oneline -10
When reporting issues, include:
- Error message (full stack trace)
- Steps to reproduce
- Environment info:
npx expo-env-info
- Performance metrics (if applicable):
performance.report()
npm start # Normal start
npm run start:offline # Bypass network checks
npm run ios # iOS simulator
npm run android # Android emulatornpm run validate # Run all checks
npm run type-check # TypeScript only
npm run lint # ESLint only
npm run format # Prettier formatnpx expo start -c # Clear cache
npx expo-doctor # Check project health
npx expo-env-info # Environment infoLast Updated: 2025-11-26