Code changes don't show up in the running app, or Metro throws confusing module resolution errors, almost always caused by a stale bundler or Watchman cache.

Clear Metro's cache along with Watchman and node_modules, then do a completely fresh rebuild on both platforms.

Step-by-Step Guide

1

Restart Metro with a clean cache: npx react-native start --reset-cache

2

Clear Watchman's watch state: watchman watch-del-all

3

Delete temp cache folders: rm -rf $TMPDIR/metro-* $TMPDIR/haste-map-*

4

Reinstall dependencies fresh: rm -rf node_modules && npm install

5

For iOS: cd ios && pod install

6

For Android: cd android && ./gradlew clean

7

Uninstall the app from the device/emulator before rebuilding

8

Check metro.config.js for a misconfigured custom resolver

Found an issue with this solution?

Related Topics

react native pod install failedwatchman crawl warningmetro config custom resolver