Console Logging
Enable detailed logging to diagnose issues:Backend Logging
Add logging to your Express server:server.ts
Frontend Logging
Monitor agent state and events:Network Debugging
Check Backend Endpoints
CORS Issues
Fix CORS configuration:server.ts
.env
Check Network in DevTools
- Open browser DevTools (F12)
- Go to Network tab
- Filter by “navai”
- Look for failed requests
- Check request/response details
WebRTC Issues
Common WebRTC Errors
WebRTC native module not found (Mobile)
WebRTC native module not found (Mobile)
Cause: Opening app in Expo Go instead of development build.Solution:
Microphone permission denied
Microphone permission denied
Cause: User denied microphone access or permission not requested.Solution for Web:
- Check browser console for permission errors
- Ensure HTTPS is used in production
- Clear browser permissions and try again
- Verify
RECORD_AUDIOpermission inapp.json - Check device Settings > Apps > Your App > Permissions
- Reinstall the app to trigger permission prompt
api_version_mismatch error
api_version_mismatch error
Symptom:
Realtime WebRTC negotiation failed (400) - “You cannot start a Realtime beta session with a GA client secret”Cause: Mixing beta/GA endpoints during WebRTC negotiation.Solution:- Use GA endpoint:
https://api.openai.com/v1/realtime/calls - Remove
openai-beta: realtime=v1header if present - Reinstall app after updating transport configuration
Network thread crash (Android)
Network thread crash (Android)
Symptom: App crashes with Then rebuild and reinstall the app.
Fatal signal 6 (SIGABRT) in org.webrtc.NetworkMonitorCause: Missing network/audio permissions for WebRTC.Solution in app.json:Mobile WebRTC Debugging
Function Execution Debugging
Functions Not Loading
Verify NAVAI_FUNCTIONS_FOLDERS
.env
src/ai/...- All files in src/ai recursivelysrc/ai/functions-modules- Specific foldersrc/ai/*.ts,src/utils/*.ts- Multiple patterns
Backend vs Frontend Functions
Understand where functions execute:Function Not Executing
Check function name conflicts
Check function name conflicts
Function names must be unique. Reserved names:
navigate_toexecute_app_function
execute_app_function.Verify payload format
Verify payload format
Functions receive payload in specific format:
Check error responses
Check error responses
Look for execution errors:
Environment Variable Issues
Variables Not Loading (Web)
Solution: NAVAI handles this internally. UseNAVAI_ prefix:
.env
Variables Not Loading (Mobile)
Generate Module Loaders
Solution:Common Error Messages
| Error | Cause | Solution |
|---|---|---|
Missing openaiApiKey | No API key configured | Set OPENAI_API_KEY in .env |
OpenAI client_secrets failed (401) | Invalid API key | Verify your OpenAI API key |
Unknown or disallowed function | Function not in registry | Check NAVAI_FUNCTIONS_FOLDERS |
Unknown or disallowed route | Route not in routes file | Verify NAVAI_ROUTES_FILE |
Invalid client-secret response | Backend not responding | Check backend is running |
Failed to load backend functions | Network or CORS issue | Verify CORS and network |
Debugging Checklist
When encountering issues, check:- Backend is running on correct port
- Environment variables are loaded
- CORS is configured properly
- OpenAI API key is valid
- Functions folder path is correct
- Routes file exists and is exported
- Module loaders are generated
- Permissions are granted (mobile)
- Network connectivity (mobile)
- Browser console for errors (web)
- Logcat for errors (mobile)
Getting More Help
Troubleshooting (Mobile)
See mobile-specific troubleshooting guide
Report Issues
Report bugs and request features
Next Steps
Deployment
Learn how to deploy NAVAI to production
