Skip to content

Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found.  #2749

Closed

Description

@LayMui

Description

<GestureHandlerRootView cause error when running unit test with jest

Steps to reproduce

yarn to install all dependencies

run
yarn test -u

throw out these error
FAIL my-design-system-react-native libs/ahua-design-system-react-native/src/tests/BottomSheet.test.js
● Test suite failed to run

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","DeviceInfo","KeyboardObserver","I18nManager"],"TurboModules":[],"NotFound":["NativeAnimatedModule","SoundManager","FrameRateLogger","RNGestureHandlerModule"]}

  1 | import React, { forwardRef } from 'react';
  2 | import { Dimensions } from 'react-native';
> 3 | import { Modalize, ModalizeProps } from 'react-native-modalize';

this was ok with RN 0.72.3 and
"react-native-gesture-handler": "^2.9.0",

Snack or a link to a repository

https://github.com/LayMui/ahuaAppTesting

Gesture Handler version

2.15.0

React Native version

0.73.2

Platforms

MacOS

JavaScript runtime

Hermes

Workflow

React Native (without Expo)

Architecture

Fabric (New Architecture)

Build type

Debug mode

Device

None

Device model

NA

Acknowledgements

Yes

Activity

  1. IvanRuch commented on Feb 9, 2024

    @IvanRuch

    I had the same problem

    cd ios
    pod install
    cd ..

    solved the problem for me

  2. LayMui commented on Feb 10, 2024

    @LayMui
    Author

    @IvanRuch what is your RN version? if it's 0.72.3 it will work for me but not 0.73.2

  3. LayMui commented on Feb 10, 2024

    @LayMui
    Author

    Hey! 👋

    The issue doesn't seem to contain a minimal reproduction.

    Could you provide a snack or a link to a GitHub repository under your username that reproduces the problem?

    unable to show the private repo as it's quite huge
    but i have provided the code snippet as above. just wonder if this react-native-gesture-handler 2.15.0 is compatible with the new latest RN version 0.73.2?

  4. LayMui commented on Feb 11, 2024

    @LayMui
    Author

    the complete error is
    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","DeviceInfo","KeyboardObserver","I18nManager"],"TurboModules":[],"NotFound":["NativeAnimatedModule","SoundManager","FrameRateLogger","RNGestureHandlerModule"]}

  5. LayMui commented on Feb 11, 2024

    @LayMui
    Author

    hi, I have provided the minimal repo at https://github.com/LayMui/ahuaAppTesting

    please take a look
    this is an issue when running
    yarn test -u
    or yarn test

  6. LayMui commented on Feb 11, 2024

    @LayMui
    Author

    could this be due to this PR not merged? #2724

  7. RafaPatino01 commented on Feb 14, 2024

    @RafaPatino01

    I'm having the same issue here

    *** Terminating app due to uncaught exception 'RCTFatalException: Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found. Verify that a module by this name is registered in the native binary.', reason: 'Unhandled JS Exception: Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found. Verify that a module by this name is registere..., stack:

  8. DevMobileAn27 commented on Feb 15, 2024

    @DevMobileAn27

    I'm having the same issue here. It happed after i installed @react-navigation/drawer, cmd: "npm install @react-navigation/drawer", my react native version is 0.73

  9. denlahodnyi commented on Feb 16, 2024

    @denlahodnyi

    I had the same issue when running my tests. This solution (link) from React Navigation docs helped me to resolve it.

    setup-jest.js

    import 'react-native-gesture-handler/jestSetup';
    

    jest.config.js

    {
      "setupFiles": [
        "<rootDir>/setup-jest.js"
      ],
    }
    
  10. 42 remaining items

  11. EmadAldardoor commented on Dec 11, 2024

    @EmadAldardoor

    i had same issues, its giving me same error log my gesture-handler 2.21.2 react-native 0.75.3 pls help me

    same issue in react-native:0.76.4, did u find the solution ?

  12. Artem0302 commented on Dec 12, 2024

    @Artem0302

    same issue with "react-native": "0.76.4" and "react-native-gesture-handler": "^2.21.2"

  13. Artem0302 commented on Dec 12, 2024

    @Artem0302

    Update: fixed by upgrading react native to 76.5

  14. Nicolas-Saade commented on Dec 27, 2024

    @Nicolas-Saade

    This is what worked for me with react native 76.5:

    rm -rf node_modules
    rm yarn.lock package-lock.json
    npm install
    cd ios
    pod install
    cd ..

    npm install react-native-gesture-handler@latest

    npm start --reset-cache
    cd ios
    xcodebuild clean
    pod install
    cd ..
    npx react-native run-ios

    It seems like the issue is related to some bad auto-linking with gesture handler module for some reason, really a shame that the manual link command has been removed in newer versions of react-native and we are not allowed to use manual linking (as far as I know), especially that the auto link never works as it should for me, would love to have this issue fixed.

  15. vyvodev commented on Jan 13, 2025

    @vyvodev
    • Upgrade node to 18
    • rm -rf node_modules
    • yarn install
    • uninstall app and rebuild work for me.
  16. CByBB commented on May 21, 2025

    @CByBB

    I have same issue.

    [runtime not ready]: Invariant Violation:
    
    TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found. Verify that a module by this name is registered in the native binary., js
    
    engine: hermes
    
  17. Princejain21 commented on May 21, 2025

    @Princejain21

    Hello @CodeByStella

    In my case, It's happening due to changing of bundleid in used apk. Mean you are using debug apk of different bundleid. solution which worked for me to create the fresh debug apk.

    thanks, Hope it will be work for you

  18. Jeh212 commented on Jun 2, 2025

    @Jeh212

    Hello Guys I'm facing this issue 'Invariant Violation: TurboModuleRegistry.getEnforcing(...): 'RNGestureHandlerModule' could not be found. Verify that a module by this name is registered in the native binary., js engine: hermes'

    I'm using the RN 0.77 and the latest version of gesture handler.

  19. Princejain21 commented on Jun 3, 2025

    @Princejain21

    Sometimes you get this error that you are using different debug apk that signed with different bundle id. To resolve this error, follow the following steps:

    1. Delete the current debug apk.
    2. Make a new build and generate the debug apk.

    It will be work then.

  20. bhavesh2706 commented on Jun 29, 2025

    @bhavesh2706

    Still facing the same issue. Please let me guide how resolve issue.

  21. aakashv321 commented on Jul 3, 2025

    @aakashv321

    Hello guys I am facing the same issues like this

    Image

    this is my package.json file

    {
    "name": "sample",
    "version": "0.0.1",
    "private": true,
    "scripts": {
    "android": "react-native run-android",
    "start-emulator": "emulator -avd Pixel_5_API_34",
    "ios": "react-native run-ios",
    "lint": "eslint .",
    "start": "react-native start",
    "test": "jest"
    },
    "dependencies": {
    "@react-native-community/netinfo": "^11.4.1",
    "@react-navigation/material-top-tabs": "^7.2.14",
    "@react-navigation/native": "^7.1.9",
    "@react-navigation/native-stack": "^7.3.13",
    "@storybook/react-native": "^9.0.14",
    "@testing-library/jest-native": "^5.4.3",
    "@testing-library/react-native": "^13.2.0",
    "axios": "^1.9.0",
    "babel-jest": "^29.7.0",
    "expo": "^53.0.16",
    "immutable": "^5.1.2",
    "react": "19.0.0",
    "react-native": "0.79.2",
    "react-native-bootsplash": "^6.3.10",
    "react-native-check-box": "^2.1.7",
    "react-native-country-picker-modal": "^2.0.0",
    "react-native-dotenv": "^3.4.11",
    "react-native-elements": "^3.4.3",
    "react-native-flash-message": "^0.4.2",
    "react-native-floating-action": "^1.22.0",
    "react-native-gesture-handler": "^2.25.0",
    "react-native-keychain": "^10.0.0",
    "react-native-otp-entry": "^1.8.4",
    "react-native-pager-view": "^6.8.1",
    "react-native-reanimated": "^3.17.5",
    "react-native-safe-area-context": "^5.4.0",
    "react-native-screens": "^4.10.0",
    "react-native-size-matters": "^0.4.2",
    "react-native-splash-screen": "^3.3.0",
    "react-native-svg": "^15.11.2",
    "react-native-vector-icons": "^10.2.0",
    "zustand": "^5.0.4"
    },
    "devDependencies": {
    "@babel/core": "^7.25.2",
    "@babel/preset-env": "^7.25.3",
    "@babel/runtime": "^7.25.0",
    "@react-native-community/cli": "18.0.0",
    "@react-native-community/cli-platform-android": "18.0.0",
    "@react-native-community/cli-platform-ios": "18.0.0",
    "@react-native/babel-preset": "0.79.2",
    "@react-native/eslint-config": "0.79.2",
    "@react-native/metro-config": "0.79.2",
    "@react-native/typescript-config": "0.79.2",
    "@rnx-kit/metro-resolver-symlinks": "^0.2.4",
    "@types/jest": "^29.5.13",
    "@types/react": "^19.0.0",
    "@types/react-test-renderer": "^19.0.0",
    "eslint": "^8.19.0",
    "jest": "^29.7.0",
    "prettier": "2.8.8",
    "react-native-svg-transformer": "^1.5.1",
    "react-test-renderer": "19.0.0",
    "typescript": "5.0.4"
    },
    "engines": {
    "node": ">=18"
    }
    }

  22. mazharrazmian commented on Aug 1, 2025

    @mazharrazmian

    Hello guys I am facing the same issues like this

    Image

    this is my package.json file

    { "name": "sample", "version": "0.0.1", "private": true, "scripts": { "android": "react-native run-android", "start-emulator": "emulator -avd Pixel_5_API_34", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", "test": "jest" }, "dependencies": { "@react-native-community/netinfo": "^11.4.1", "@react-navigation/material-top-tabs": "^7.2.14", "@react-navigation/native": "^7.1.9", "@react-navigation/native-stack": "^7.3.13", "@storybook/react-native": "^9.0.14", "@testing-library/jest-native": "^5.4.3", "@testing-library/react-native": "^13.2.0", "axios": "^1.9.0", "babel-jest": "^29.7.0", "expo": "^53.0.16", "immutable": "^5.1.2", "react": "19.0.0", "react-native": "0.79.2", "react-native-bootsplash": "^6.3.10", "react-native-check-box": "^2.1.7", "react-native-country-picker-modal": "^2.0.0", "react-native-dotenv": "^3.4.11", "react-native-elements": "^3.4.3", "react-native-flash-message": "^0.4.2", "react-native-floating-action": "^1.22.0", "react-native-gesture-handler": "^2.25.0", "react-native-keychain": "^10.0.0", "react-native-otp-entry": "^1.8.4", "react-native-pager-view": "^6.8.1", "react-native-reanimated": "^3.17.5", "react-native-safe-area-context": "^5.4.0", "react-native-screens": "^4.10.0", "react-native-size-matters": "^0.4.2", "react-native-splash-screen": "^3.3.0", "react-native-svg": "^15.11.2", "react-native-vector-icons": "^10.2.0", "zustand": "^5.0.4" }, "devDependencies": { "@babel/core": "^7.25.2", "@babel/preset-env": "^7.25.3", "@babel/runtime": "^7.25.0", "@react-native-community/cli": "18.0.0", "@react-native-community/cli-platform-android": "18.0.0", "@react-native-community/cli-platform-ios": "18.0.0", "@react-native/babel-preset": "0.79.2", "@react-native/eslint-config": "0.79.2", "@react-native/metro-config": "0.79.2", "@react-native/typescript-config": "0.79.2", "@rnx-kit/metro-resolver-symlinks": "^0.2.4", "@types/jest": "^29.5.13", "@types/react": "^19.0.0", "@types/react-test-renderer": "^19.0.0", "eslint": "^8.19.0", "jest": "^29.7.0", "prettier": "2.8.8", "react-native-svg-transformer": "^1.5.1", "react-test-renderer": "19.0.0", "typescript": "5.0.4" }, "engines": { "node": ">=18" } }

    Could you solve it? I am also having this exact same issue.

  23. kjkjkjj557 commented on Oct 9, 2025

    @kjkjkjj557

    for react native 0.79.5 , adding add(RNGestureHandlerPackage()) in MainApplication.java , fixed this problem for me

  24. aladine commented on Oct 26, 2025

    @aladine

    I encountered the same issue with my Android project, which is upgrading from RN76.x to RN77.x. I discovered that my project uses the turbo C++ setup with the OnLoad.cpp file. The java module not found happens to all other dependencies, not limited to RNGestureHandlerModule.

    This file is changed in React Native 77+ versions. After updating, the issue was resolved.

  25. kaarthicksiyer commented on Jan 21, 2026

    @kaarthicksiyer

    Hi guys I am facing the same issue on Android (non -expo) for a quite a while now. I am building the app from Android studio

    "react-native-gesture-handler": "2.21.0"
    "react": "18.3.1",
    "react-native": "0.76.5"

    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":["HeadlessJsTaskSupport","PlatformConstants","SourceCode","DeviceInfo","UIManager","DeviceEventManager","NativeAnimatedModule","SoundManager","I18nManager","DeviceInfo","Timing"],"TurboModules":[],"NotFound":["NativePerformanceObserverCxx","NativePerformanceCxx","NativeReactNativeFeatureFlagsCxx","RedBox","BugReporting","RNCSafeAreaContext","RNSModule","RNEdgeToEdge","ReanimatedModule","RNGestureHandlerModule"]}, js engine: hermes
    Invariant Violation: "Rewards" 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`
    Image

    This is my package.json. I am new to RN so not sure how to debug and fix this issue. I have tried all methods that I could find but no use.
    "dependencies": { "@react-native-community/geolocation": "2.0.2", "@react-native-community/netinfo": "11.2.1", "@react-native-masked-view/masked-view": "0.3.0", "@react-navigation/bottom-tabs": "6.6.1", "@react-navigation/material-top-tabs": "6.6.3", "@react-navigation/native": "^6.0.8", "@react-navigation/native-stack": "6.11.0", "react-native-gesture-handler": "2.21.0", "react-native-htmlview": "0.17.0", "react-native-image-placeholder": "1.0.14", "react-native-maps": "1.3.2", "react-native-pager-view": "^6.2.3", "react-native-reanimated": "3.16.7", "react-native-safe-area-context": "^4.10.5", "react-native-screens": "4.11.0", "react-native-snap-carousel": "3.9.1", "react-native-tab-view": "3.5.2", "metro": "^0.83.3", "metro-config": "^0.83.3", "metro-core": "^0.83.3", "metro-react-native-babel-transformer": "^0.77.0", "react": "18.3.1", "react-native": "0.76.5" }, "devDependencies": { "@react-native-community/cli": "^20.1.0", "@react-native/metro-config": "0.75.2" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions