gpt4 book ai didi

react-native - 重复声明 "AnimatedComponent"可能是 react-native 的内部错误

转载 作者:行者123 更新时间:2023-12-04 04:57:48 25 4
gpt4 key购买 nike

我将 react-native 从 0.48.4 升级到 0.51.0 之后我收到了这个错误。每当我运行打包程序时。这是控制台输出

bundling failed: TypeError: /node_modules/react-native/Libraries/Animated/src/createAnimatedComponent.js: Duplicate declaration "AnimatedComponent" (This is an error on an internal node. Probably an internal error)
at File.buildCodeFrameError (/node_modules/babel-core/lib/transformation/file/index.js:427:15)
at Scope.checkBlockScopedCollisions (/node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js:398:27)
at Scope.registerBinding (/node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js:592:16)
at Scope.registerDeclaration (node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js:496:14)
at Object.BlockScoped (node_modules/babel-core/node_modules/babel-traverse/lib/scope/index.js:244:28)
at Object.newFn (node_modules/babel-core/node_modules/babel-traverse/lib/visitors.js:318:17)
at NodePath._call (node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:76:18)
at NodePath.call (/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:44:14)
at NodePath.visit (/node_modules/babel-core/node_modules/babel-traverse/lib/path/context.js:105:12)

信息:当我在 react-native 48.4 工作时,如果我启用热模块重新加载(hmr),我曾经得到这个错误。更新到 51.0 后,由于捆绑错误,我无法开发服务器

最佳答案

可能问题出在 transform-react-remove-prop-types babel 插件上。

尝试从 .babelrc 中删除这个插件,它会解决问题。

关于react-native - 重复声明 "AnimatedComponent"可能是 react-native 的内部错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49205721/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com