Troubleshooting
No native client available / silent fallback
On first run or in dev, JS may fall back to the built-in fetch when native isn't available yet.
Solution: Rebuild the app after installing dependencies:
npx react-native run-android
npx react-native run-ios
Prefetch error: "missing prefetchKey"
Provide headers: { prefetchKey: '...' } or init.prefetchKey when calling prefetch() and when consuming via fetch():
// Both calls need the same prefetchKey
await prefetch(url, { headers: { prefetchKey: 'my-key' } });
const res = await fetch(url, { headers: { prefetchKey: 'my-key' } });
Cronet provider details (Android)
The library logs available Cronet providers and prefers the "Native" provider. Check Android logs for provider name/version during initialization:
adb logcat | grep -i cronet
WebSockets not connecting
If you're having issues with WebSocket connections:
- Ensure all three packages are installed:
react-native-nitro-websockets,react-native-nitro-text-decoder,react-native-nitro-modules - Rebuild the app after installation
- Check that your WebSocket URL uses
ws://orwss://scheme - For
wss://, the TLS handshake requires valid certificates
See the WebSockets guide for full setup instructions.