Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native Duplicate module name

Our webapp depends on React 15. To maintain parity between the Android/iOS devices, import React from "react"; should yield React 15 even on the devices. However, after installing [email protected] via npm and attempting to start the Android app in dev mode, I'm a receiving this error:

Failed to build DependencyGraph: @providesModule naming collision:
Duplicate module name: IOSDefaultEventPluginOrder Paths: /node_modules/react/lib/IOSDefaultEventPluginOrder.js collides with /node_modules/react-native/Libraries/ReactIOS/IOSDefaultEventPluginOrder.js

This error is caused by a @providesModule declaration with the same name accross two different files. Error: @providesModule naming collision: Duplicate module name: IOSDefaultEventPluginOrder
Paths: /node_modules/react/lib/IOSDefaultEventPluginOrder.js collides with /node_modules/react-native/Libraries/ReactIOS/IOSDefaultEventPluginOrder.js

This error is caused by a @providesModule declaration with the same name accross two different files. at HasteMap._updateHasteMap (/node_modules/node-haste/lib/DependencyGraph/HasteMap.js:160:15) at /node_modules/node-haste/lib/DependencyGraph/HasteMap.js:125:25

I understand that this is due to React and React Native containing the same js file, but does anyone know if there is a way to properly resolve these dependencies?

Environment: - Mac OSX (latest) - Android (have not tested on iOS) - React Native 0.25.0-rc

like image 981
bcwebb88 Avatar asked May 05 '16 13:05

bcwebb88


1 Answers

Never mind - updating to React Native 26.0-rc fixes this issue since React 15.0.2 is now a dependency.

like image 93
bcwebb88 Avatar answered Sep 29 '22 08:09

bcwebb88