最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - React Native error: Export namespace should be first transformed by `@babelplugin-proposal-export-namespace-from -

programmeradmin4浏览0评论

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

System Config

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

System Config

Share Improve this question asked Jul 20, 2022 at 5:21 Avinash AAvinash A 7812 gold badges9 silver badges27 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 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)

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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论