TypeError: _ReanimatedModule.default.configureProps is not a function.

Please I am facing this error currently in my expo app, is there anyone that can help please, I just upgrade our app to expo / SDK 46.0.0, React native 0.69.6, and I was forced to upgrade to reanimated 2.9.1. thereby bringing this error every time I run npm start —clear, I have imported it in barbel.config.js as mentioned in the documentation. thank you.

Complete errors:

 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)
 ERROR  Invariant Violation: "main" 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.


Please help thanks.

Hi @sheriffgrandeur,

This seems to be a similar issue already reported in Reanimated library where there are multiple instances of Reanimated and each instance tries to use the same module.

Please check the solution provided in this PR: Detect two versions of Reanimated by piaskowyk · Pull Request #3441 · software-mansion/react-native-reanimated · GitHub and see if it resolves your issue.

Hi @amanhimself, thanks for your reply. with overrides, in pakage.json as stated in the issue you pointed out, it works but the error only changes to another one

New error:

 global.__reanimatedWorkletInit is not a function.

It seems to be related to the bundler cache issue, as stated here. You can try npx expo start --clear command to clear the bundler cache and restart the development server.

Thank you so much, i did that many time, i don’t even know how but the error kept on changing.
as mentioned here
I called these in app.js

import  'react-native-reanimated';  
global.__reanimatedWorkletInit = () => {};

this is the new error.

TypeError: (0, _core.configureProps) is not a function.

I’m unable to reproduce this error on my end. I’d suggest asking in Reanimated GitHub repo by opening an issue for this.

Hi @amanhimself, thanks for your reply. I was not able to resolve the reanimated issue so for that I created a fresh expo project and copy (package.json, screens, and components) but unfortunately, there is another weird error that’s been thrown. I am so devastated right now. something that’s supposed to take a few hours is taking 3-4 days now.

this is the error I am getting

 ERROR  Error: Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: number.

Check the render method of `index`.

I am using class components and I have checked through all the screens and components I did not see any mismatch of import/export. if you have time can you help look at it? or any suggestion you think may help? thank you.

Hey, I’m sorry you’re stuck on an issue like this, and I understand that this is frustrating.

The error you stated is usually caused by some component not being exported correctly but being imported in another. I’d suggest you to check the library imports in your project. Maybe there is a library import that has changed over time. For example, a similar forum post like this.

Also, if you feel you can share a minimal reproducible example, I can take a look, or if you can share it in a repo privately.

Hi @amanhimself , Thank you so much for your help. I later figured it out. It’s the svgs. Normally, we can’t import svg direct as a component in the native apps the way we used to on the web, however, there’s one package that usually does that though. “Svg transformer”. Without the package transformed the svg, it will be returning numbers hence causing the app breaking and resulting to that errors.

Since I have just made a fresh project so I forgot to do the configuration.

Though I have to abandon the first project since was not able To resolve reanimated error.
But the fresh one is working now.

Thanks.

1 Like