Ever run a fresh compilation on a React Native project, change absolutely nothing, and watch your simulator immediately crash with this terminal masterpiece?
ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found. Verify that your native modules are linked correctly.
It usually happens right after initializing a navigation library or an interactive UI package that relies on react-native-gesture-handler under the hood.
If you are stuck looking at this stack trace right now, here is exactly why it is broken and how to resolve it in two minutes.
The Root Cause: JavaScript Is Floating Alone
When you run standard web frameworks, importing a package updates your node dependency tree and just works. In React Native, complex packages have two distinct layers:
- The JavaScript API layer (the code you write in your editor).
- The Native Architecture layer (the actual Swift/Objective-C or Java/Kotlin binaries compiled into the iOS/Android app wrappers).
This error occurs because your Metro bundler successfully loaded the new JavaScript components, but your local native build directory has no idea those new binaries exist yet. The framework is trying to call native routines that simply weren't compiled during your last native build cycle.
How to Fix It
1. For Expo Development Builds (Most Common)
If you are using Expo and running prebuilds, simply running a standard terminal refresh won't pass the native binary threshold. You need to trigger a full native binary compilation sequence to force Expo to link the missing native modules folder structure into your binary targets:
# For Android simulators/devices:
npx expo run:android
# For iOS simulators/devices:
npx expo run:ios
2. For Bare React Native Projects
If you are managing your own native folders directly, you need to clear your build cache and explicitly map the cocoapods dependency layer for iOS:
# Clear out your local build artifacts
watchman watch-del-all && rm -rf node_modules && npm install
# Re-link native iOS libraries
cd ios && pod install && cd ..
# Rebuild your active runtime binary
npx react-native run-ios
Once the compilation pipeline finishes creating the new application layout, the native module registration bridge hooks up properly, and your navigation screens will load without a hitch.
Hopefully, this saves you from losing an hour down a stack trace rabbit hole today.
If you run into other cryptic Expo or React Native native errors while building, I put together a quick web diagnostic tool called FixMyError.dev that contextually reverse-engineers stack traces into human-readable resolutions like this one. There's a free live sandbox on the landing page if you just want to test it out next time your terminal starts throwing errors.
Back to building!