react-native-reanimated: TypeError: _ReanimatedModule.default.configureProps is not a function

Description

  • Started this as a discussion but got no hits and it could be bug (certainly something I can’t figure out).
  • I am in the process of updating our app, updating Reanimated from 1.9.0 to 2.8.0, which also includes various updates to React Native 0.67, React Navigation 6 etc, so there could be issues there.
  • Every time I try to build the project, I encounter this error:
TypeError: _ReanimatedModule.default.configureProps is not a function

Simulator Screen Shot - iPhone 13 - 2022-06-27 at 15 29 43

  • The file in question looks to be in NavigationOptions.js, which for reference looks like:
export const navigationOptions = (options: Object): Object => ({
  navigation,
}: {
  navigation: NavigationStateType,
}) => ({
  ...options,
})

export const navigationOptionsWithTitle = (options: Object): Object => {
  const initialObject = { ...options }

  return ({ route }: {route: NavigationRouteType}) => ({
    ...initialObject,
    ...titleOptions,
    title: route?.params?.title || options?.title || ''
  })
}

export const navigationOptionsWithDrawer = (options: Object): Object => ({
  navigation,
}: {
  navigation: NavigationStateType,
}) => ({
  headerRight: () => <DrawerButton navigation={navigation} />,
  ...options,
})

export const navigationOptionsWithComponentTitle = (options: Object): Object => ({
  navigation,
}: {
  navigation: NavigationStateType,
}) => ({
  headerTitle: () => <NavigationHeaderTitle navigation={navigation} />,
  ...options,
})

Expected behaviour

  • Updating Reanimated should ideally not cause any errors.

Actual behaviour & steps to reproduce

  • This is a tough one as I’m not able to reproduce it. If someone has seen a similar issue then that would be helpful.
  • I’m thinking there could be some issue with our configuration of React Navigation, which for some reason isn’t working on Reanimated v2.

Snack or minimal code example

  • Unable to replicate this in a snack repo 😦(((

Package versions

name version
react-native 0.67.4
react-native-reanimated 2.8.0
NodeJS 14.17.6
Xcode 13.3
Java 11.0.11
Gradle 7.4.2

Affected platforms

  • Android
  • iOS
  • Web

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 6
  • Comments: 32 (8 by maintainers)

Commits related to this issue

Most upvoted comments

I got this error too, I adjusted the resolutions in package.json, and it worked for me https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/

  "resolutions": {
    "react-native-reanimated": "^2.9.1"
  },

Same problem, nothing works, _ReanimatedModule.default.createNode is not a function

I’m facing with this type of error. ERROR - n.default.configureProps is not a function. “react”: “18.2.0”, “react-native”: “0.69.1”.

The good news, I can reproduce this issue and I know why this happens. I will fix it and describe the source of the problem.

Another way to look for things like that would be to run npm why react-native-reanimated

I solved it by using older version:

The error occured I installed the drawer navigation. I followed the documentation (babel plugin, plus import gesture handler in App.tsx like in the docs) and it gave me error. I then downgraded it to 3.3.0. These are my packages: “@react-navigation/bottom-tabs”: “^6.5.8”, “@react-navigation/drawer”: “^6.6.4”, “@react-navigation/native”: “^6.1.7”, “@react-navigation/native-stack”: “^6.9.13”, “@react-navigation/stack”: “^6.3.17”, “expo”: “~49.0.8”, “react-native-reanimated”: “3.3.0”, “react-native-gesture-handler”: “^2.12.0”,

I got this error too, I adjusted the resolutions in package.json, and it worked for me https://classic.yarnpkg.com/lang/en/docs/selective-version-resolutions/

  "resolutions": {
    "react-native-reanimated": "^2.9.1"
  },

THIS WORKED FOR ME!!

THANK YOU!!!

Hey @nialldbarber, Do you sure that you pass all installation steps after updating to Reanimatedc 2? https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/installation Remember also about clearing the cache after the update - yarn start --reset-cache

ERROR TypeError: _ReanimatedModule.default.configureProps is not a function. (In ‘_ReanimatedModule.default.configureProps(Object.keys(NATIVE_THREAD_PROPS_WHITELIST), Object.keys(UI_THREAD_PROPS_WHITELIST))’, ‘_ReanimatedModule.default.configureProps’ is undefined)

any fix?