Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React-Native-Reanimated: error: node_modules\react-native-reanimated\src\index.ts:

I was making new project and I can't run the Android emulator with this error.

enter image description here

enter image description here

It is located at 'node_modules\react-native-reanimated\src\index.ts' and this is just the code there:

// tree-shaken side effects
import './reanimated2/js-reanimated/global';

// @ts-ignore backward compatibility with treeshaking
export * from './reanimated1';
export * from './reanimated2';
export * as default from './Animated';

enter image description here

What can I try next?

like image 715
marceline Avatar asked Jun 15 '26 10:06

marceline


1 Answers

I also search for an answer and this worked for me.

Visit this expo reanimated docs link https://docs.expo.dev/versions/latest/sdk/reanimated/#installation

and I added this in my 'babel.config.js' file

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

I think the presets depends if you are using expo. Here is the original code given by the docs:

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

you can see that I used my default preset which is module:metro.

like image 191
marceline Avatar answered Jun 17 '26 01:06

marceline



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!