12

I am getting the following error when I am running react native application using react-native-cli

error: node_modules\react-native-reanimated\src\index.ts: 
D:\Desktop\coding\Github\Stocksy\node_modules\react-native-reanimated\src\index.ts: 
Export namespace should be first transformed by `@babel/plugin-proposal-export-namespace-from`.

I am attaching the screenshot of error I am getting with my system configuration enter image description here

System Config enter image description here

2 Answers 2

20

Try this: -

  1. npm install react-native-reanimated

  2. In babel.config.js insert plugins: ['react-native-reanimated/plugin'] (make sure its at the end, it should look like this: -

    module.exports = { presets: ['module:metro-react-native-babel-preset'], plugins: ['react-native-reanimated/plugin'], };

  3. run react-native start --reset-cache

  4. run your native app (For ios example - npx react-native run-ios)

Sign up to request clarification or add additional context in comments.

1 Comment

If your using the 'react-native-paper' library make a separate plugins:['react-native-reanimated/plugin'] and below that use the babel config which is in the env for 'react-native-paper/babel' as per documentation.
1

What you have to do is add this config to your babel.config.js and restart your app. plugins: ['react-native-reanimated/plugin'],

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.