Debug School

rakesh kumar
rakesh kumar

Posted on

Error "Cannot read property 'makeMutable' of undefined" in a React Native Reanimated setup/configuration

The error "Cannot read property 'makeMutable' of undefined" in your screenshot is a React Native Reanimated setup/configuration issue—not a problem with your code imports.

I added the following to my

babel.config.js: plugins: ['react-native-reanimated/plugin']
Enter fullscreen mode Exit fullscreen mode

I then restarted my system.
Then I did:

npm i react-native-reanimated 
Enter fullscreen mode Exit fullscreen mode

if you are using yarn you can use yarn add react-native-reanimated
After that I ran :

npm run start -- --reset-cache
Enter fullscreen mode Exit fullscreen mode

==============================================================
solution

module.exports = {
  presets: ['module:metro-react-native-babel-preset'],
  plugins: [
    // ...other plugins
    'react-native-reanimated/plugin', // <-- MUST be last
  ],
};
Enter fullscreen mode Exit fullscreen mode

================
Create/Update metro.config.js
This is critical for Reanimated 3.x and often missed:


const { getDefaultConfig, mergeConfig } = require('@react-native/metro-config');
const { wrapWithReanimatedMetroConfig } = require('react-native-reanimated/metro-config');

const config = {};

module.exports = wrapWithReanimatedMetroConfig(
  mergeConfig(getDefaultConfig(__dirname), config)
);
Enter fullscreen mode Exit fullscreen mode

================================================

Stop Metro bundler if running

cd android && ./gradlew clean && cd ..
npx react-native start --reset-cache
npx react-native run-android
Enter fullscreen mode Exit fullscreen mode

============or===============

# Clean node_modules (recommended)
rm -rf node_modules package-lock.json
npm install

# Clean Android build
cd android
./gradlew clean
cd ..

# Start with clean cache
npx react-native start --reset-cache

# In a new terminal
npx react-native run-android
Enter fullscreen mode Exit fullscreen mode

===============================================

npm install react-native-reanimated@3.14.0 --save
Enter fullscreen mode Exit fullscreen mode

Top comments (0)