react-native-reanimated icon indicating copy to clipboard operation
react-native-reanimated copied to clipboard

TypeError: ReanimatedModule.installTurboModule is not a function

Open kokosky93 opened this issue 2 years ago • 26 comments

Description

Following error is beeing thrown when try to use createAnimatedComponent method

Error: Requiring module "node_modules\react-native-reanimated\src\createAnimatedComponent.tsx", which threw an exception: TypeError: ReanimatedModule.installTurboModule is not a function

except adding plugins: ['react-native-reanimated/plugin'] is there anything I have to do regarding to the package configuration?

Expected behavior

Actual behavior & steps to reproduce

Snack or minimal code example

import Animated from 'react-native-reanimated'

Animated.createAnimatedComponent(HStack)

It applies to other methods as well. For example

useSharedValue(0)

throws the same exception.

Package versions

+-- @babel/[email protected] +-- @react-navigation/[email protected] +-- @react-navigation/[email protected] +-- @types/[email protected] +-- @types/[email protected] +-- @types/[email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] +-- [email protected] `-- [email protected]

name version
react-native 0.64.3
react-native-reanimated 2.5.0
NodeJS 14.16.1
expo 44.0.6

Affected platforms

  • [x] Android
  • [ ] iOS
  • [ ] Web

kokosky93 avatar Apr 03 '22 06:04 kokosky93

I am also getting this lately while running jest tests.

"react-native-reanimated": "^2.3.2", "jest": "^26.6.3",

Cookizza avatar Apr 22 '22 13:04 Cookizza

Also getting this on iOS when upgrading from version 1.9.0 -> 2.8.0

arron-olio avatar Apr 25 '22 21:04 arron-olio

I am also getting on version 2.8.0

orhangazi avatar Apr 30 '22 14:04 orhangazi

Same issue with 2.8.0

FrederickEngelhardt avatar May 02 '22 07:05 FrederickEngelhardt

Same issue with

  • react-native-reanimated 2.8.0
  • react-native 0.68 (with hermes, without fabric)
  • only tested on iOS

MathisBarre avatar May 04 '22 13:05 MathisBarre

I'm getting the same issue upgrading as well.

I tried going to 2.8.0 and also 2.6.0 as I need to ensure support for Gradle 7+, which looks like it came in this release.

We were previously on 1.9.0, but need to upgrade reanimated as we are upgrading react native.

Here are some hopefully relevant deps we use:

"@react-navigation/bottom-tabs": "5.11.15",
"@react-navigation/compat": "5.3.20",
"@react-navigation/drawer": "5.12.9",
"@react-navigation/native": "5.9.8",
"@react-navigation/stack": "5.14.9",
"react": "17.0.1",
"react-native": "0.64.2", <- going up to version `0.65.2` soon
"react-native-draggable-flatlist": "3.1.1",
"react-native-gesture-handler": "1.10.3",
"react-native-reanimated": "2.6.0",

nialldbarber avatar May 14 '22 10:05 nialldbarber

Hey, could someone provide a repo to reproduce this issue? pls 🙏

piaskowyk avatar May 17 '22 15:05 piaskowyk

Did anyone have idea about how to fix this issue? With 2.8.0, I keep getting this error. Any help would be greatly appreciated!

rexwalawala avatar Jun 10 '22 04:06 rexwalawala

I'm still getting the same error. There has to be a way to get around this issue?

kevu-ml avatar Jun 14 '22 15:06 kevu-ml

It might help someone: we updated expo to 45 but jest-expo was still in 44. Updating to 45 fixed this issue for us.

christophehurpeau avatar Jun 27 '22 15:06 christophehurpeau

I was facing the same issue and I solved with this mock in my jest.setup.js

jest.mock('react-native', () => {
  const RN = jest.requireActual('react-native');
  RN.NativeModules.ReanimatedModule.installTurboModule = function () {};
  return RN;
});

ricardo-alan avatar Jul 01 '22 14:07 ricardo-alan

Getting this on Detox. Mocking is not an option for obvious reasons

shamilovtim avatar Jul 12 '22 22:07 shamilovtim

"expo": "~44.0.0",
"react-native-reanimated": "~2.9.1"

react-native-reanimated: 2.8.0 same issue but 2.9.1 solved this problem

---after 8.30 just install expo install react-native-reanimated then installed 2,3.1, and solved problem

bryce0516 avatar Aug 23 '22 03:08 bryce0516

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?

github-actions[bot] avatar Aug 23 '22 03:08 github-actions[bot]

I have the same issue and nothing helps

iSaBo96 avatar Sep 23 '22 04:09 iSaBo96

i am also having the same issue

swatantragoswami09 avatar Oct 17 '22 16:10 swatantragoswami09

Same same

brianangulo avatar Oct 24 '22 21:10 brianangulo

Same here

eeshabarua avatar Oct 28 '22 02:10 eeshabarua

Same

lucas5g avatar Nov 03 '22 20:11 lucas5g

same issue with reanimated 2.14.4 for react native version 0.66.3

yash-visit avatar Feb 14 '23 12:02 yash-visit

Same here

yxwandroid avatar Jul 28 '23 05:07 yxwandroid

Is there any update about the issue?

turgay2317 avatar Oct 08 '23 16:10 turgay2317

Any update on this. Currently facing this when upgrading reanimated to 3.5.4 on a brownfield app

anil-eeposit avatar Oct 30 '23 05:10 anil-eeposit

Has this problem been resolved?

see3p00 avatar Nov 01 '23 06:11 see3p00

TypeError: ReanimatedModule.installTurboModule is not a function. (In 'ReanimatedModule.installTurboModule()', 'ReanimatedModule.installTurboModule' is undefined)

i have the same issue in react native version 71.14 and reanimated version 3.5.4

gopikamurali avatar Jan 08 '24 14:01 gopikamurali