Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Duplicate declaration "AnimatedComponent" Probably an internal error in react-native

I upgraded react-native from 0.48.4 to 0.51.0 After that I am getting this error. whenever I am running packager.Here is the console output

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)

Info : When I was working react-native 48.4 If I enable Hot module reloading(hmr) I used to get this error .After updating to 51.0 I could not able to development server because of bundling error

like image 615
Dinesh Chitta Avatar asked Dec 17 '25 18:12

Dinesh Chitta


1 Answers

Probably issue is with transform-react-remove-prop-types babel plugin.

Try removing this plugin from .babelrc , it will solves the problem.

like image 109
Manikanta C.S.E Avatar answered Dec 19 '25 14:12

Manikanta C.S.E



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!