software-mansion / react-native-reanimated

React Native's Animated library reimplemented
https://docs.swmansion.com/react-native-reanimated/
MIT License
9.03k stars 1.3k forks source link

TypeError: ReanimatedModule.installTurboModule is not a function #3130

Open kokosky93 opened 2 years ago

kokosky93 commented 2 years ago

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/core@7.17.8 +-- @react-navigation/drawer@6.4.1 +-- @react-navigation/native@6.0.10 +-- @types/react@17.0.43 +-- @types/react-native@0.64.24 +-- @types/shortid@0.0.29 +-- expo@44.0.6 +-- expo-linking@3.0.0 +-- expo-status-bar@1.2.0 +-- moti@0.17.1 +-- native-base@3.3.10 +-- prettier@2.6.1 +-- react@17.0.1 +-- react-dom@17.0.1 +-- react-native@0.64.3 +-- react-native-checkbox-reanimated@0.1.1 +-- react-native-gesture-handler@2.3.2 +-- react-native-reanimated@2.5.0 +-- react-native-safe-area-context@4.2.4 +-- react-native-screens@3.13.1 +-- react-native-svg@12.3.0 +-- react-native-web@0.17.1 +-- shortid@2.2.16 +-- styled-components@5.3.5 +-- styled-system@5.1.5 `-- typescript@4.3.5

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

Affected platforms

Cookizza commented 2 years ago

I am also getting this lately while running jest tests.

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

arron-olio commented 2 years ago

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

orhangazi commented 2 years ago

I am also getting on version 2.8.0

FrederickEngelhardt commented 2 years ago

Same issue with 2.8.0

MathisBarre commented 2 years ago

Same issue with

nialldbarber commented 2 years ago

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",
piaskowyk commented 2 years ago

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

rexwalawala commented 2 years ago

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!

kevu-ml commented 2 years ago

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

christophehurpeau commented 2 years ago

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

ricardo-alan commented 2 years ago

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;
});
shamilovtim commented 2 years ago

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

bryce0516 commented 2 years ago
"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

github-actions[bot] commented 2 years ago

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?

iSaBo96 commented 2 years ago

I have the same issue and nothing helps

swatantragoswami09 commented 2 years ago

i am also having the same issue

brianangulo commented 2 years ago

Same same

eeshabarua commented 2 years ago

Same here

lucas5g commented 2 years ago

Same

yash-visit commented 1 year ago

same issue with reanimated 2.14.4 for react native version 0.66.3

yxwandroid commented 1 year ago

Same here

turgay2317 commented 1 year ago

Is there any update about the issue?

anil-eeposit commented 1 year ago

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

see3p00 commented 1 year ago

Has this problem been resolved?

gopikamurali commented 10 months ago

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

dasler-fw commented 3 weeks ago

try "react-native-reanimated": "3.15.5",