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

Requiring module "node_modules/react-native-reanimated/src/Animated.js", which threw an exception: TypeError: undefined is not an object

Open MrGautamojha opened this issue 4 years ago • 9 comments

Getting such error in node terminal

Screenshot 2021-12-27 at 4 03 50 PM

React-native --0.65 "react-native-reanimated": "^2.3.1", "react-native-gesture-handler": "^2.1.0",

MrGautamojha avatar Dec 27 '21 10:12 MrGautamojha

This looks like a cache problem, could you create all cache in your application (yarn start --reset-cache)? But if it doesn't help, would you prepare an example repo to produce your issue?

piaskowyk avatar Dec 27 '21 11:12 piaskowyk

I got the same error after expo updating, any help?

anasalaqeel avatar Dec 28 '21 11:12 anasalaqeel

This looks like a cache problem, could you create all cache in your application (yarn start --reset-cache)? But if it doesn't help, would you prepare an example repo to produce your issue?

not worked for me.

MrGautamojha avatar Dec 29 '21 10:12 MrGautamojha

Really, I want to help, but if anyone won't provide a reproduction I'm not able to fix it :/

piaskowyk avatar Dec 29 '21 12:12 piaskowyk

Make sure your babel.config.js looks like below

module.exports = function(api) {
  api.cache(true);
  return {
    presets: ['babel-preset-expo'],
    plugins: ['react-native-reanimated/plugin'],
  };
};

Once that is done the run expo r -c to clear the cache

lewisMachilika avatar Dec 31 '21 07:12 lewisMachilika

@MrGautamojha did you find any solution for this? I am also facing the same error.

masnoonmulla avatar Jan 08 '22 06:01 masnoonmulla

i have the same issue

Riadh-Mkhinini avatar Jan 17 '22 15:01 Riadh-Mkhinini

@MrGautamojha did you find any solution for this? I am also facing the same error.

Downgrade NPM version fixed this issue for now

"react-native-gesture-handler": "1.10.3", "react-native-reanimated": "1.9.0",

MrGautamojha avatar Jan 20 '22 09:01 MrGautamojha

It looks like there is now an expo command to fix the version number issue: expo doctor --fix-dependencies

Also make sure you clear cache again as suggested above

benrbowers avatar Jul 02 '22 23:07 benrbowers