I recently upgraded my React Native project from version 0.75.4 to 0.76.9. After upgrading, I’m encountering an issue related to the Fetch API:
• When I build and run the app via Xcode, the API requests work normally without any problems.
• However, after reloading the app using Metro bundler (e.g., by pressing Cmd+R), all API requests using fetch fail immediately.
• The fetch call does not throw a normal error — instead, the response has a statusCode=0 and no response body.
There are no related errors shown in the Metro console or Xcode logs when this happens.
Environment:
• React Native: 0.76.9
• iOS Simulator (Xcode 15)
• Node.js 18+
• macOS Sonoma
Things I tried:
• Cleaning the build (npx react-native clean, yarn cache clean, delete node_modules and reinstall).
• Resetting Metro cache (npx react-native start --reset-cache).
• Making sure my server (API backend) supports CORS correctly.
• Testing with both development and production backend servers.
Additional notes:
• This issue did not happen in 0.75.4.
• If I kill and rebuild the app from Xcode again, the fetch API works fine — only breaks after a Metro reload.
Has anyone encountered this after upgrading to 0.76.x? Would appreciate any advice or pointers. Thank you so much!