You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found #2847
In process of installing @gorhom/bottom-sheet package, I was installing the gesture-handler package. I followed all the steps of installation which included adding import statements (import 'react-native-gesture-handler') to both App.tsx and index.js. In app.tsx, GestureHandlerRootView wraps the contents. The code breaks even when I comment out the @gorhom/bottom-sheet package and components.
Of course in debugging this whole debacle,
Deleted the pod files, podfile.lock, and node_modules folder.
Pod install and npm install in respective folders
Clean build folder in xcode
Deleted DerivedData
Rebuild
Since this is very similar to #2749, I've tried all the solutions there. Nothing has worked.
Hi @lynajiang! I've just build your app on both, iOS simulator and real device and everything works fine (though there was an error that useMemo was not imported). Are you sure you've properly cleaned your environment? Make sure to delete pods and node_modules
Yes. I am sure I properly cleaned the environment. I uninstalled and reinstalled a couple of times. If I were to comment out "import 'react-native-gesture-handler';" in both App.tsx and index.js as well as import { GestureHandlerRootView } from 'react-native-gesture-handler'; in App.tsx (and commenting out GestureHandlerRootView). I would not get any errors. This of course would make the bottomsheet component error since the Gesture Handler module is not sufficiently installed.
The full error message is:
ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: false. TurboModule interop: false. Modules loaded: {"NativeModules":["PlatformConstants","LogBox","Timing","AppState","SourceCode","BlobModule","WebSocketModule","SettingsManager","DevSettings","RedBox","Networking","Appearance","DevLoadingView","UIManager","DeviceInfo"],"TurboModules":[],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","BugReporting","HeadlessJsTaskSupport","RNGestureHandlerModule"]}, js engine: hermes
LOG Running "Lemon" with {"rootTag":1,"initialProps":{}}
ERROR Invariant Violation: "Lemon" has not been registered. This can happen if:
Metro (the local dev server) is run from the wrong folder. Check if Metro is running, stop it and restart it in the current project.
A module failed to load due to an error and AppRegistry.registerComponent wasn't called., js engine: hermes
And I have never used react-gesture-handler before. I had just installed the most up-to-date version of both react-native and react-gesture-handler packages.
Reacted by Anusha-mathur, Noah Phillips, vedant, Cameron Moss, Prasanna Dangol, Saqlain Ashraf and Nagma Kapoor
I am currently facing the same issue here. Is this beacuse dependency problem during instalation, because i use react 18 on my project.. Here is the log result upon installing rect-native-gesture-handler. Please note that after i user yard, the package installed in my node_module project yet i get the ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found.
Here is the error upon installing react-native-gesture-handler
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: AwesomeProject@0.0.1
npm ERR! Found: @types/react@18.3.0
npm ERR! node_modules/@types/react
npm ERR! dev @types/react@"^18.2.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @types/react@"^16.9.19" from native-base@3.3.1
npm ERR! node_modules/native-base
npm ERR! native-base@"3.3.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/patricktelnoni/.npm/_logs/2024-04-26T16_34_16_030Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/patricktelnoni/.npm/_logs/2024-04-26T16_34_16_030Z-debug-0.log
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: AwesomeProject@0.0.1
npm ERR! Found: @types/react@18.3.0
npm ERR! node_modules/@types/react
npm ERR! dev @types/react@"^18.2.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @types/react@"^16.9.19" from native-base@3.3.1
npm ERR! node_modules/native-base
npm ERR! native-base@"3.3.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/patricktelnoni/.npm/_logs/2024-04-26T16_34_16_030Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/patricktelnoni/.npm/_logs/2024-04-26T16_34_16_030Z-debug-0.log
weird thing happened .... I am struggling with this for 4 days, back and forth, cleaning and nuking the project to zero etc, and today I've made a typo, and it fixed it (not sure why).
So I tried this:
cd ios
RCT_NEW_ARCH_ENABLED=1 pod install
this messed up everything, nothing was working so I wanted to go back to the original method, but I've made a typo (I've found it in my bash history):
I run this:
3. RCT_NEW_ARCH_ENABLED=1=0 pod install
Since this thread has now over 32 comments, we have to take some action. There were many suggested solutions, as well as other problems mentioned (like Unhandled SoftException com.facebook.react.bridge.ReactNoCrashSoftException: Tried to access onWindowFocusChange while context is not ready). At this point there's nothing we can do about this issue since the only reproduction works fine on our machines. I will close this issue because it seems that it is strongly connected to user setup and there's no generic solution.
If this issue is still bothering you, please open a new one. Before doing so, please first check if this project works fine. If it does, then the problem probably lies in your setup and there's not much that we can do about it. In that case you can contact as at projects@swmansion.com. Otherwise, please remember to attachminimal, reproducible example (issues without working reproduction will be closed).
For anyone looking into this issue, it has been closed as it seems strongly connected with user setup and we are not able to reproduce it.
You can still open it as new issue. Before doing so, please first check if this project works fine. If it does, then the problem probably lies in your setup and there's not much that we can do about it. In that case you can contact as at projects@swmansion.com. Otherwise, please remember to attachminimal, reproducible example.
Caution
As stated in this comment issues without working reproduction will be closed!
Hi! It's been a while and I think we've managed to find out what was causing this issue.
Turns out that if react-native-gesture-handler is not a direct dependency of app, codegen will not be run for it. You can see that in this function . It means that if your app is using any library that has react-native-gesture-handler as peerDependency, react-native-gesture-handler won't be linked and codegen will not detect it, even though it will be installed in node_modules.
The solution to this problem is to simply add react-native-gesture-handler to your app dependency list.
Activity
m-bert commentedon Apr 4, 2024
Hi @lynajiang! I've just build your app on both, iOS simulator and real device and everything works fine (though there was an error that
useMemowas not imported). Are you sure you've properly cleaned your environment? Make sure to deletepodsandnode_moduleslynajiang commentedon Apr 5, 2024
Yes. I am sure I properly cleaned the environment. I uninstalled and reinstalled a couple of times. If I were to comment out "import 'react-native-gesture-handler';" in both App.tsx and index.js as well as import { GestureHandlerRootView } from 'react-native-gesture-handler'; in App.tsx (and commenting out GestureHandlerRootView). I would not get any errors. This of course would make the bottomsheet component error since the Gesture Handler module is not sufficiently installed.
m-bert commentedon Apr 5, 2024
In that case could you provide more information about this error? Like stack trace or full error message?
m-bert commentedon Apr 5, 2024
Also, have you encountered this issue before? Did it happen after upgrading gesture handler (or react native) version?
lynajiang commentedon Apr 5, 2024
The full error message is:
ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found. Verify that a module by this name is registered in the native binary.Bridgeless mode: false. TurboModule interop: false. Modules loaded: {"NativeModules":["PlatformConstants","LogBox","Timing","AppState","SourceCode","BlobModule","WebSocketModule","SettingsManager","DevSettings","RedBox","Networking","Appearance","DevLoadingView","UIManager","DeviceInfo"],"TurboModules":[],"NotFound":["NativePerformanceCxx","NativePerformanceObserverCxx","BugReporting","HeadlessJsTaskSupport","RNGestureHandlerModule"]}, js engine: hermes
LOG Running "Lemon" with {"rootTag":1,"initialProps":{}}
ERROR Invariant Violation: "Lemon" has not been registered. This can happen if:
AppRegistry.registerComponentwasn't called., js engine: hermesAnd I have never used react-gesture-handler before. I had just installed the most up-to-date version of both react-native and react-gesture-handler packages.
lynajiang commentedon Apr 5, 2024
I also have pushed a cleaner version of the code.
anucreative commentedon Apr 6, 2024
lynajiang commentedon Apr 7, 2024
@anucreative Thank you! After downgrading gesture-handler to 2.15.0, it worked.
m-bert commentedon Apr 8, 2024
Though downgrading may help, it is not a solution that we recommend. I will keep this issue open until we find out what causes that problem.
naitik-bhavsar commentedon Apr 15, 2024
I am also facing the same issue
patricktelnoni commentedon Apr 26, 2024
I am currently facing the same issue here. Is this beacuse dependency problem during instalation, because i use react 18 on my project.. Here is the log result upon installing rect-native-gesture-handler. Please note that after i user yard, the package installed in my node_module project yet i get the ERROR Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found.
Here is the error upon installing react-native-gesture-handler
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: AwesomeProject@0.0.1
npm ERR! Found: @types/react@18.3.0
npm ERR! node_modules/@types/react
npm ERR! dev @types/react@"^18.2.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @types/react@"^16.9.19" from native-base@3.3.1
npm ERR! node_modules/native-base
npm ERR! native-base@"3.3.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/patricktelnoni/.npm/_logs/2024-04-26T16_34_16_030Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/patricktelnoni/.npm/_logs/2024-04-26T16_34_16_030Z-debug-0.log
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: AwesomeProject@0.0.1
npm ERR! Found: @types/react@18.3.0
npm ERR! node_modules/@types/react
npm ERR! dev @types/react@"^18.2.6" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @types/react@"^16.9.19" from native-base@3.3.1
npm ERR! node_modules/native-base
npm ERR! native-base@"3.3.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! /Users/patricktelnoni/.npm/_logs/2024-04-26T16_34_16_030Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /Users/patricktelnoni/.npm/_logs/2024-04-26T16_34_16_030Z-debug-0.log
20 remaining items
petertoth-dev commentedon Oct 20, 2024
@darkmoor24 WHAT exactly did you do to solve it? You linked the whole thread and it's about testing running jest, and not running the project itself
petertoth-dev commentedon Oct 20, 2024
weird thing happened .... I am struggling with this for 4 days, back and forth, cleaning and nuking the project to zero etc, and today I've made a typo, and it fixed it (not sure why).
So I tried this:
cd iosRCT_NEW_ARCH_ENABLED=1 pod installthis messed up everything, nothing was working so I wanted to go back to the original method, but I've made a typo (I've found it in my bash history):
I run this:
3.
RCT_NEW_ARCH_ENABLED=1=0 pod installFor some reason everything is working now LOL :D
Package versions that worked:
m-bert commentedon Oct 21, 2024
Hi @petertoth-dev!
We do support newer versions of React Native, as well as New Architecture
It works because now this variable is treated as string
1=0, andPodfileenablesfabricif it is equal to1. In other words, your app runs onpaper.m-bert commentedon Oct 21, 2024
Since this thread has now over 32 comments, we have to take some action. There were many suggested solutions, as well as other problems mentioned (like
Unhandled SoftException com.facebook.react.bridge.ReactNoCrashSoftException: Tried to access onWindowFocusChange while context is not ready). At this point there's nothing we can do about this issue since the only reproduction works fine on our machines. I will close this issue because it seems that it is strongly connected to user setup and there's no generic solution.If this issue is still bothering you, please open a new one. Before doing so, please first check if this project works fine. If it does, then the problem probably lies in your setup and there's not much that we can do about it. In that case you can contact as at projects@swmansion.com. Otherwise, please remember to attach minimal, reproducible example (issues without working reproduction will be closed).
MobileMon commentedon Oct 25, 2024
I'm also getting this same issue in an expo project
its working when i run from expo GO but when i run the app in release mode directly from xcode i encounter the error
so edit scheme -> run -> release in xcode to reproduce
and run on a physical device
@m-bert
SSL-ACTX commentedon Oct 27, 2024
Same issue. It runs fine in Expo Go, but after building it... Got this issue...
nathanguigui commentedon Dec 10, 2024
Upgrading to react-native
0.76.5did the tricks and solved the issuem-bert commentedon Dec 12, 2024
For anyone looking into this issue, it has been closed as it seems strongly connected with user setup and we are not able to reproduce it.
You can still open it as new issue. Before doing so, please first check if this project works fine. If it does, then the problem probably lies in your setup and there's not much that we can do about it. In that case you can contact as at projects@swmansion.com. Otherwise, please remember to attach minimal, reproducible example.
Caution
As stated in this comment issues without working reproduction will be closed!
m-bert commentedon May 26, 2025
Hi! It's been a while and I think we've managed to find out what was causing this issue.
Turns out that if
react-native-gesture-handleris not a direct dependency of app,codegenwill not be run for it. You can see that in this function . It means that if your app is using any library that hasreact-native-gesture-handleraspeerDependency,react-native-gesture-handlerwon't be linked andcodegenwill not detect it, even though it will be installed innode_modules.The solution to this problem is to simply add
react-native-gesture-handlerto your app dependency list.Kudos to @qwertychouskie for his investigation ❤
If the issue still persists, you can open new one. Please remember to attach minimal, reproducible example.
Caution
As stated in this comment issues without working reproduction will be closed!