Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RN upgrade: Resolve RCTBridgemodule duplicate (RN 0.48 regression) #2505

Closed
3 tasks
oskarth opened this issue Nov 22, 2017 · 1 comment
Closed
3 tasks

RN upgrade: Resolve RCTBridgemodule duplicate (RN 0.48 regression) #2505

oskarth opened this issue Nov 22, 2017 · 1 comment

Comments

@oskarth
Copy link
Contributor

oskarth commented Nov 22, 2017

User Story

As a developer, I want to make RN upgrade build work so we can move forward with planned changes.

Description

Type: Bug

Summary: There's an issue with RN 0.48 regressions that effects us in multiple libraries. I have a temporary fix for this but we need to fork libraries and fix this permanently. See facebook/react-native#15775 for details.

Expected behavior

Build works (well, fails at a later stage).

Actual behavior

Build fails at fixable stage.

Reproduction

Devs only: Reset stuff and build.

Solution

Summary: Right now I'm patching node modules to fix import path. This is the right way to fix it:

  • Fork relevant libs (Instabug, react-native-http-bridge (@alwx!) to status-im org).
  • Apply patch there (see below)
  • Use this version in status-react

Additional Information

  • Operating System: iOS

Logs

react-native run-ios:

In file included from /Users/oskarth/git/status-react/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTBridge.h:13:
/Users/oskarth/git/status-react/ios/build/Build/Products/Debug-iphonesimulator/include/React/RCTBridgeModule.h:54:16: error: redefinition of 'RCTMethodInfo'
typedef struct RCTMethodInfo {
               ^
In file included from /Users/oskarth/git/status-react/node_modules/instabug-reactnative/ios/RNInstabug/InstabugReactBridge.m:7:
In file included from /Users/oskarth/git/status-react/node_modules/instabug-reactnative/ios/RNInstabug/InstabugReactBridge.h:10:
../../../node_modules/react-native/React/Base/RCTBridgeModule.h:54:16: note: previous definition is here
typedef struct RCTMethodInfo {

without patch.

ag -a --hh RCTBridgeModule -l  | grep http
cp node_modules/react-native-http-bridge/ios/RCTHttpServer.h{,.bak}

ag -a --hh RCTBridgeModule -l  | grep instabug
cp node_modules/instabug-reactnative/ios/RNInstabug/InstabugReactBridge.h{,.bak}

diff -u node_modules/instabug-reactnative/ios/RNInstabug/InstabugReactBridge.h{.bak,} > rn-upgrade-instabug.patch

diff -u node_modules/react-native-http-bridge/ios/RCTHttpServer.h{.bak,} > rn-upgrade-http-bridge.patch

Now apply those patch files whenever installing node modules. This is the commit that should be added to our fork (under status-im) of these two repos.

@oskarth
Copy link
Contributor Author

oskarth commented Nov 23, 2017

To clarify, patch files are here 59bc4ae I did it quickly so might need to adjust manually, but intent is clear.

@yenda yenda closed this as completed Sep 21, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants