Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

React Native: @providesModule declaration with the same name across two different files

We've got two repos, both of which have react-native as dependencies; one being the actual RN app and the other a UI package with a number of custom react-native components in it.

When I symlink (using npm link) the UI package with the RN app and try start the js server, it throws the follow error:

This error is caused by a @providesModule declaration with the same name across two different files.

It seems to be because it's picking up the same RN files inside the UI package's copy of react-native.

I know there's a problem with watchman not working with symlinks, however I think this is different - to do with there being two react-native modules. Does anyone know a way to get around this please? I've made sure that both are the same version number but still nothing.

like image 205
Johnny Copperstone Avatar asked Feb 10 '17 15:02

Johnny Copperstone


1 Answers

This has been destroying my day as well. as a quick workaround, you can just go delete the folder of react-native out of the node_modules folder within react-native-router-flux.(node_modules > react-native-router-flux > node_modules > react-native) Ugly, but will at least get you up and running for the time being

like image 71
hafiz ali Avatar answered Sep 21 '22 12:09

hafiz ali