react-native: [RN 0.49-rc.5] Fishhook error

Is this a bug report?

No.

I tried to manually upgrade from 0.48.3 to 0.49-rc.5 due to the BLOB_URL error that happens in sed version.

https://github.com/facebook/jest/issues/4433 https://github.com/facebook/react-native/issues/15810

When upgrading everything went well until the following error occurred:

I tried adding:

pod "React", :path => react_native_path, :subspecs => ['DevSupport', 'fishhook']

However this did nothing for me, there is currently no documentation on how to integrate fishhook when manually upgrading. Can anyone help?

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: macOS Sierra 10.12.4 Node: 7.8.0 Yarn: 0.24.6 npm: 5.4.0 Xcode: Xcode 8.3.3 Build version 8E3004b

Packages: (installed) react-native: 0.49-rc.5 react: 16.0.0-alpha.12

Target Platform: iOS (10.3)

Expected Behavior

Build succeeds

Actual Behavior

Build fails because it cannot find fishhook files

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 22
  • Comments: 45 (12 by maintainers)

Commits related to this issue

Most upvoted comments

update I figured it out to be a mis-import in reconnecting websocket, it links to

#import "<fishhook/fishhook.h>"

while it should link to

#import "fishhook.h"

@johannth You can add a postinstall script to fix that issue into your package.json like

"scripts": {
        "postinstall": "sed -i '' 's#<fishhook/fishhook.h>#\"fishhook.h\"#g' ./node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m",
        // any other scripts here
},
  • still happening in 0.52

This is a similar issue to https://github.com/facebook/react-native/issues/13198

I think this stems from Cocoapods not defining subspecs as modules/frameworks so there is no fishhook module and we can’t do <fishhook/fishhook.h>. I’ve asked on the Cocoapods mailing list to confirm but I agree that the import is probably wrong and should either be:

#import <React/fishhook.h>

or

#import "fishhook.h"

An alternative in this case would be to depend on the fishhook Cocoapod instead of the embedded subspec. Then the import could stay as it is.

This issue is not resolved in RN 0.56.0-rc.2.

having the same issue too in 0.49.3.

Also, there was a similar issue, still happening in 0.49.3:

import <RCTAnimation/RCTValueAnimatedNode.h>

I believe this is addressed in https://github.com/facebook/react-native/pull/16192 so I’m going to close this. That commit should go out with 0.49.1 in an hour or so.

We’re adding something like this to our packages.json file:

"scripts": {
    "postinstall": "sed -i '' 's/#import <fishhook\\/fishhook.h>/#import <React\\/fishhook.h>/' ./node_modules/react-native/Libraries/WebSocket/RCTReconnectingWebSocket.m"
}

Hi guys,

Today I came across with the integration to an existing platform using swift and I ran into several issues…

Reduced my podfile to this:

target 'sampleApp' do
    use_frameworks!
  
    pod "yoga", :path => "../node_modules/react-native/ReactCommon/yoga"
    # Third party deps podspec link
    pod 'DoubleConversion', :podspec => '../node_modules/react-native/third-party-podspecs/DoubleConversion.podspec'
    pod 'GLog', :podspec => '../node_modules/react-native/third-party-podspecs/GLog.podspec'
    pod 'Folly', :podspec => '../node_modules/react-native/third-party-podspecs/Folly.podspec'
  
    pod 'React', :path => '../node_modules/react-native', :subspecs => [
      'Core',
      'CxxBridge',
      'DevSupport',
      'RCTText',
      'RCTImage',
      'RCTNetwork',
      'RCTSettings',
      'RCTWebSocket', # needed for debugging
    ]
  end

Once all the pods are installed, build does not work as RCTReconnectingWebSocket.m can’t find the import

#import <fishhook/fishhook.h>

Checking the source code I have managed to get it to work at the moment by changing that line to

#import "fishhook.h"

or

#import <React/fishhook.h>

I can see this issue has been closed and merged… (and reopened?)… but it seems quite unstable to me…

these are my dependencies.

		"react": "^16.1.0",
		"react-native": "^0.50.3"

+1 still happening in 0.49.3

That’s what is creating this problem. So there is a major issue that make it impossible to use RN with use_frameworks! currently.

Reopening since people seem to be having issues still but am not working on it / don’t know that anyone is, just to set expectations.

I’d also add that to remove potential discrepancies between dev environments, the patch that fixed this issue in some contexts was tested with Xcode 9 on Mac 10.13.

This has not been fixed. Here is the line that is causing the issue when you are using cocoapods with frameworks: RCTReconnectingWebSocket.m

Hi @tirrorex, unfortunately, it is not a “fix” is a hack.

The change provided will not work for my CI as we do not tend to check in node_modules or pods as the matter of fact. The CI agent will be downloading its own copy and work from there.

It would be nice to follow the documentation and actually get it to work without issues nor guessing what’s wrong this time.

Fairly new to react, but opened a PR here addressing the import: https://github.com/facebook/react-native/pull/16271/files

@mobinni Also installed React for the first time using cocoapods and followed the guide here: https://facebook.github.io/react-native/docs/integration-with-existing-apps.html Also seeing the missing fishhook import