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 0.49-rc.5] Fishhook error #16039

Closed
mobinni opened this issue Sep 20, 2017 · 45 comments
Closed

[RN 0.49-rc.5] Fishhook error #16039

mobinni opened this issue Sep 20, 2017 · 45 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@mobinni
Copy link

mobinni commented Sep 20, 2017

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.

jestjs/jest#4433
#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

@mobinni
Copy link
Author

mobinni commented Sep 28, 2017

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
Copy link

This is a similar issue to #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.

@ide
Copy link
Contributor

ide commented Oct 4, 2017

I believe this is addressed in #16192 so I'm going to close this. That commit should go out with 0.49.1 in an hour or so.

@ide ide closed this as completed Oct 4, 2017
@iwasrobbed-ks
Copy link

@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
},

@mobinni
Copy link
Author

mobinni commented Oct 5, 2017

@rob-keepsafe It is fixed in 0.49.1, the issue doesn't occur on a lower version, so it should be good

@iwasrobbed-ks
Copy link

@mobinni @ide This still appears broken in 0.49.1 :\ The script above works fine for now

@mobinni
Copy link
Author

mobinni commented Oct 5, 2017

@rob-keepsafe are you using pods, in which case you would need to pod update for it to take full effect.

I updated from 0.48 to 0.49.1 and it worked just fine after clearing my workspace (cmd shift alt k, cmd shift k), running a clean install, then pod updating

@iwasrobbed-ks
Copy link

I just installed React today for the first time, so it's been using 0.49.1 by default. The pods just point to the local podspecs in the node_modules directory as well

screen shot 2017-10-05 at 4 16 27 pm

Deleting the node_modules/ and Pods/ directories, derived data, etc. doesn't work on my end

@macdoum1
Copy link
Contributor

macdoum1 commented Oct 9, 2017

@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

@ide
Copy link
Contributor

ide commented Oct 9, 2017

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.

@ide ide reopened this Oct 9, 2017
@macdoum1
Copy link
Contributor

macdoum1 commented Oct 9, 2017 via email

@iwasrobbed-ks
Copy link

@macdoum1 No, but you can work around it for now via #16039 (comment)

@macdoum1
Copy link
Contributor

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

@shuhaodo
Copy link

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>

@bithavoc
Copy link

this is still happening in 0.49.3

@karpov3
Copy link

karpov3 commented Oct 23, 2017

the same problem in 0.50.0-rc.1

@AtomicCactus
Copy link

+1 still happening in 0.49.3

@jgsamudio
Copy link

This happened to me when creating a new react native project. I found out that removing use_frameworks! in the podfile worked resolve the fishhook import error

@rodrigoelp
Copy link

rodrigoelp commented Nov 10, 2017

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"

@bithavoc
Copy link

@rodrigoelp I went for not using react native modules from cocoapods, only use cocoapods for non-RN dependenfies that RN modules being linked with “react-native link”.

@tirrorex
Copy link

@bithavoc can't find any ressources on how to integrate react-native into an existing app without cocoapods.

Modifying the source-code works for now but it is a ugly fix, would be great to have a real pr on this.

@ptomasroos
Copy link
Contributor

This is not happening to us and we're running cocoapods and has done since 2015. We're currently at the 0.51.0 release

@MoOx
Copy link
Contributor

MoOx commented Feb 28, 2018

@ptomasroos are you using use_framework!? I didn't have this issue until I enabled it (in order to integrate a new rn module that use swift)

@ptomasroos
Copy link
Contributor

Nope not using use_framework @MoOx

@MoOx
Copy link
Contributor

MoOx commented Feb 28, 2018

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

@msand
Copy link
Contributor

msand commented Mar 9, 2018

Try the patches from here: #17764 (comment)

@msand
Copy link
Contributor

msand commented Mar 10, 2018

This should probably be solved using this approach: #13198 (comment)

@matteocollina
Copy link

This is my gist for RN 0.51.0 and React 16.0.0 (it works)
https://gist.github.com/matteocollina/fe2a9c3e2a96061ac1a15c0fcf2cbded

@chrisballinger
Copy link

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

@rodrigoelp
Copy link

rodrigoelp commented Jun 20, 2018

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

@keshavkaul
Copy link

keshavkaul commented Jun 28, 2018

@MoOx I am using Swift and have use_frameworks! enabled. This issue still persists in RN 0.56.0-rc.4

@rodrigoelp Is pointing to the right file and line of the error

changing #import <fishhook/fishhook.h> to #import <React/fishhook.h> works. This is not a solution.

macdoum1 added a commit to macdoum1/react-native that referenced this issue Jun 28, 2018
macdoum1 added a commit to macdoum1/react-native that referenced this issue Jun 28, 2018
macdoum1 added a commit to macdoum1/react-native that referenced this issue Jun 28, 2018
facebook-github-bot pushed a commit that referenced this issue Jun 28, 2018
…16271)

Summary:
RCTReconnectingWebSocket is not compiling correctly because of an incorrect import (#16039).

Everything build and run as usual.

[IOS] [BUGFIX] [Fishhook] - Correct fishhook import in RCTReconnectingWebSocket Fixes #16039
Closes #16271

Differential Revision: D8679758

Pulled By: hramos

fbshipit-source-id: b05dda3a01a68ace87f11889b84ce6b323e5c16a
hramos pushed a commit that referenced this issue Jul 4, 2018
…16271)

Summary:
RCTReconnectingWebSocket is not compiling correctly because of an incorrect import (#16039).

Everything build and run as usual.

[IOS] [BUGFIX] [Fishhook] - Correct fishhook import in RCTReconnectingWebSocket Fixes #16039
Closes #16271

Differential Revision: D8679758

Pulled By: hramos

fbshipit-source-id: b05dda3a01a68ace87f11889b84ce6b323e5c16a
@facebook facebook locked as resolved and limited conversation to collaborators Jun 17, 2019
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jun 17, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet