ERROR TypeError: _RNGestureHandlerModule.default.flushOperations is not a function (it is undefined), js engine: hermes
E

10

12

I create the React Native Expo Mobile app. I got this error in android ERROR TypeError: _RNGestureHandlerModule.default.flushOperations is not a function (it is undefined), js engine: hermes.But,Not in IOS .how solve this error in android

Need Correct Answer. I am working On expo 50

Enumerate answered 8/2 at 5:11 Comment(0)
M
13

I had the same issue. It got fixed when I install react-native-gesture-handler as recommended by Pratik Prakash.

npx expo install react-native-gesture-handler
Markus answered 8/2 at 15:3 Comment(1)
i tried using npm install which didnt work, but this did!Respondence
C
3

I was able to install react-native-gesture-handler with

npx expo install react-native-gesture-handler 

but I am still getting this error as well: ERROR TypeError: _RNGestureHandlerModule.default.flushOperations is not a function (it is undefined), js engine: hermes

I have been importing it like so

import { GestureHandlerRootView} from 'react-native-gesture-handler'

I am also only experiencing this issue on Android, but not on iOS

Congresswoman answered 9/2 at 14:58 Comment(1)
Did you find any solution? I'm also getting the same error on android but not IOSNetwork
J
3

As previous answers suggest installing react-native-gesture-handler resolves the issue.

But in the codebase react-native-gesture-handler is not used anywhere, I don't get it, what is the purpose of installing the library that you don't use. Does it have something to do with expo?

enter image description here

Jenn answered 11/2 at 3:6 Comment(0)
P
3

For me was different version of this package installed on the project, so be aware in case you getting such error you probably will also get this warnings in logs: error when is installed different version of react-native-gesture-handler

Next solution is to check if you have this package installed. A good advice for me was to follow instructions presented in errors, 90% responses is there.

Palpitation answered 21/2 at 23:49 Comment(0)
O
2
npx expo install react-native-gesture-handler

works for me ass well, don`t forget to stop the server and run again, if it still show problem try clear the expo cache:

npx expo start --clear
Occasionalism answered 15/2 at 13:7 Comment(0)
S
2

Update the dependencies in your project. this way,

for npm,

npm install @react-navigation/native@latest
npm install react-native-gesture-handler@latest
npm install react-native-reanimated@latest

for yarn,

yarn add @react-navigation/native@latest
yarn add react-native-gesture-handler@latest
yarn add react-native-reanimated@latest
Solemnize answered 29/3 at 9:12 Comment(1)
npm install @react-navigation/native@latest worked for me, thanksTenpin
E
1
Euh answered 8/2 at 6:4 Comment(0)
D
1

I had the same issue. I had old codebase which I wanted to update with the latest versions. I was able to mitigate the issue following the below expo documentation. https://docs.expo.dev/tutorial/gestures/#install-and-configure-libraries

Dyane answered 11/2 at 14:21 Comment(0)
F
0

Please ensure that the following dependencies and their respective versions are accurately specified in your package.json file:

"react-native": "0.73.4",
"react-native-gesture-handler": "~2.14.0",
"react-native-reanimated": "3.6.2"
Frontier answered 2/5 at 20:0 Comment(0)
R
0

for react native, the reason is as a result of the "react-native-gesture-handler" version is higher than the javascript version. You can reduce the version to lower version

"react-native-gesture-handler": "^1.10.3",

Remark answered 14/6 at 8:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.