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

Fix react-native link fails #14863

Closed
wants to merge 2 commits into from
Closed

Fix react-native link fails #14863

wants to merge 2 commits into from

Conversation

HazAT
Copy link

@HazAT HazAT commented Jul 6, 2017

I've noticed that react-native link doesn't link correctly anymore.
Took some time until I found out that params passed in the android link step is an empty array.
I am pretty sure the reason for this lies somewhere else, this fixes the issue though.
So I made the check in the if more explicit which shouldn't harm either way.

Before the fix:
$ react-native link react-native-sentry

Scanning 563 folders for symlinks in /Users/haza/Projects/sentry-examples/react-native/AwesomeProject/node_modules (5ms)

After the fix:
$ react-native link react-native-sentry

react-native link react-native-sentry
Scanning 563 folders for symlinks in /Users/haza/Projects/sentry-examples/react-native/AwesomeProject/node_modules (6ms)
rnpm-install info Linking react-native-sentry android dependency
rnpm-install info Android module react-native-sentry has been successfully linked
rnpm-install info Linking react-native-sentry ios dependency
rnpm-install info iOS module react-native-sentry has been successfully linked
android/sentry.properties already exists
ios/sentry.properties already exists

@facebook-github-bot
Copy link
Contributor

Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file. In order for us to review and merge your code, please sign up at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need the corporate CLA signed.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@facebook-github-bot facebook-github-bot added GH Review: review-needed CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. labels Jul 6, 2017
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!

@HazAT HazAT changed the title Fix react-native link empty params Fix react-native link fails Jul 7, 2017
@taquayle
Copy link

taquayle commented Aug 2, 2017

Thanks for this!, was driving me insane trying to get link to go anything

@grabbou
Copy link
Contributor

grabbou commented Aug 3, 2017

cc: @Kureev

@HazAT
Copy link
Author

HazAT commented Aug 30, 2017

Sorry, I don't like to bump things but this still seems broken for some versions.
@grabbou @Kureev

@Kureev
Copy link
Contributor

Kureev commented Aug 30, 2017

Sorry for not reacting earlier. I'm on it right now. Will test it on a blank project. If I can reproduce the issue and fix it by running react-native link from your branch - I'll give my approve.

@halilb
Copy link

halilb commented Aug 30, 2017

I can confirm this PR fixes the linking problem for my project. I've been applying this patch before linking anything for some time.

Thank for the fix @HazAT.

@Kureev
Copy link
Contributor

Kureev commented Aug 30, 2017

I just checked the current state of the link using blank project and react-native-sentry. So far it all works good.

Here is my package.json:

{
        "name": "Test",
        "version": "0.0.1",
        "private": true,
        "scripts": {
                "start": "node node_modules/react-native/local-cli/cli.js start",
                "test": "jest"
        },
        "dependencies": {
                "react": "16.0.0-alpha.12",
                "react-native": "0.47.2",
                "react-native-sentry": "^0.22.0"
        },
        "devDependencies": {
                "babel-jest": "20.0.3",
                "babel-preset-react-native": "3.0.2",
                "jest": "20.0.4",
                "react-test-renderer": "16.0.0-alpha.12"
        },
        "jest": {
                "preset": "react-native"
        }
}

In the project I use

react-native-cli: 2.0.1
react-native: 0.47.2

For some reason I can't reproduce your issue. Can you be a bit more specific about it?

@HazAT
Copy link
Author

HazAT commented Aug 30, 2017

@Kureev I can confirm that this error is gone for the latest react-native version 0.47.2.
As I wrote in the initial PR comment the reason for this possibly lies somewhere else than the fix I submitted.
But this was broken for a version in the past.
So I let you decide what to do from here, probably you can just close it and people should upgrade their react-native if they are still having troubles.

@Kureev
Copy link
Contributor

Kureev commented Aug 30, 2017

@HazAT I'm wondering if you know the way we can fix it for previous versions. IIRC there were no incidents when the previous version has been patched after the new one is released with the fix.

Theoretically speaking: if I merge this PR, it'll land in something like 0.47.3 or 0.48, but in these versions the issue you want to fix is already gone, so I don't see any arguments for merging.

Don't get me wrong, you did a great job investigating and solving the issue, but because of the delay from our side it is not relevant anymore 😞 . I'm very sorry for this experience, especially taking into account it is your first contribution to the project. I hope it won't undermine your trust in the community or RN team and we'll see your contributions in the future.

I'm about to close this PR as the issue is already fixed in the newest version. If you feel there is still something we need to do, feel free to ping me to re-open this.

Thanks for understanding!

@Kureev Kureev closed this Aug 30, 2017
@HazAT
Copy link
Author

HazAT commented Aug 30, 2017

@Kureev No problem at all 😄
I totally understand the decision, would have done the same.
move fast, break things, fix stuff >>> never release anything
that's the best and worst thing about react native 😂

@HazAT
Copy link
Author

HazAT commented Aug 31, 2017

@Kureev Another user of ours reported that it's not working.
Turns out the broken version was 0.47.0

Steps to reproduce:
react-native init AwesomeProject --version react-native@0.47.0
cd AwesomeProject
yarn add react-native-sentry
react-native link react-native-sentry

Output:

Scanning 583 folders for symlinks in /private/tmp/AwesomeProject/node_modules (9ms)

So no actual linking, since this is working in 0.47.2 there is nothing to do, I just wanted to document this for completeness.

@MovingGifts
Copy link

MovingGifts commented Sep 24, 2017

Got it working, thank you @HazAT :)

@Anees-Raja
Copy link

Still having the same issue as @HazAT posted on Aug 31

facebook-github-bot pushed a commit that referenced this pull request Feb 27, 2019
Summary:
This sync includes the following changes:

- **[8e25ed20b](facebook/react@8e25ed20b )**: Unify noop and test renderer assertion APIs (#14952) //<Andrew Clark>//
- **[870214f37](facebook/react@870214f37 )**: Deprecate ref.setNativeProps in favor of ReactNative.setNativeProps (#14912) //<Eli White>//
- **[3989c0950](facebook/react@3989c0950 )**: eslint-plugin-react-hooks@1.3.0 //<Dan Abramov>//
- **[1bbfbc98d](facebook/react@1bbfbc98d )**: [ESLint] Add more cases to exhaustive-deps rule (#14930) //<Dan Abramov>//
- **[412f88296](facebook/react@412f88296 )**: fix(eslint-plugin-react-hooks): node engine updated to version 7 because of object.entries(#14951) //<Farhad Yasir>//
- **[ba708fa79](facebook/react@ba708fa79 )**: Remove ReactNoop.flushDeferredPri and flushUnitsOfWork (#14934) //<Andrew Clark>//
- **[920b0bbb3](facebook/react@920b0bbb3 )**: [scheduler] Pass didTimeout argument to callbacks (#14931) //<Andrew Clark>//
- **[f99fca3cb](facebook/react@f99fca3cb )**: Fix sample ESLint configuration (#14926) //<Matt Thomson>//
- **[22bb94764](facebook/react@22bb94764 )**: Release eslint-plugin-react-hooks@1.2.0 //<Dan Abramov>//
- **[a77bbf1a1](facebook/react@a77bbf1a1 )**: [ESLint] Warn against assignments from inside Hooks (#14916) //<Dan Abramov>//
- **[219ce8a9c](facebook/react@219ce8a9c )**: Fix tracing fixture (#14917) //<Dan Abramov>//
- **[8c1966590](facebook/react@8c1966590 )**: Release 16.8.3 //<Dan Abramov>//
- **[7de4d2391](facebook/react@7de4d2391 )**: Fix UMD builds by re-exporting the scheduler priorities (#14914) //<Dan Abramov>//
- **[d0318fb3f](facebook/react@d0318fb3f )**: Updating copyright headers, dropping the year (#14893) //<Nathan Hunzaker>//
- **[f978d5fde](facebook/react@f978d5fde )**: Fix warning message for new setNativeProps method. on -> with (#14909) //<Eli White>//
- **[b0f45c0fc](facebook/react@b0f45c0fc )**: Adding ReactNative.setNativeProps that takes a ref (#14907) //<Eli White>//
- **[4f4aa69f1](facebook/react@4f4aa69f1 )**: Adding setNativeProps tests for NativeMethodsMixin (#14901) //<Eli White>//
- **[b96b61dc4](facebook/react@b96b61dc4 )**: Use the canonical nativeTag for Fabric's setNativeProps (#14900) //<Eli White>//
- **[dab2fdbbb](facebook/react@dab2fdbbb )**: Add eslint-plugin-react-hooks/exhaustive-deps rule to check stale closure dependencies (#14636) //<Dan Abramov>//
- **[1493abd7e](facebook/react@1493abd7e )**: Deleted empty App.css (#14149) //<Josh R>//
- **[13645d224](facebook/react@13645d224 )**: Deal with fallback content in Partial Hydration (#14884) //<Sebastian Markbåge>//
- **[c506ded3b](facebook/react@c506ded3b )**: Don't discard render phase state updates with the eager reducer optimization (#14852) //<Dan Abramov>//
- **[0e67969cb](facebook/react@0e67969cb )**: Prompt to include UMD build artifact links in GitHub release (#14864) //<Brian Vaughn>//
- **[fad0842fd](facebook/react@fad0842fd )**: Release scripts documentation (#14863) //<Brian Vaughn>//
- **[ab7a67b1d](facebook/react@ab7a67b1d )**: Fix react-dom/server context leaks when render stream destroyed early (#14706) //<overlookmotel>//
- **[3e5556043](facebook/react@3e5556043 )**: Release 16.8.2 //<Dan Abramov>//
- **[dfabb77a9](facebook/react@dfabb77a9 )**: Include another change in 16.8.2 //<Dan Abramov>//
- **[c555c008b](facebook/react@c555c008b )**: Include component stack in 'act(...)' warning (#14855) //<Sunil Pai>//
- **[ff188d666](facebook/react@ff188d666 )**: Add React 16.8.2 changelog (#14851) //<Dan Abramov>//
- **[c4d8ef643](facebook/react@c4d8ef643 )**: Fix typo in code comment (#14836) //<Deniz Susman>//
- **[08e955435](facebook/react@08e955435 )**: Statically enable suspense/partial hydration flag in www (#14842) //<Sebastian Markbåge>//
- **[0e4135e8c](facebook/react@0e4135e8c )**: Revert "[ShallowRenderer] Queue/rerender on dispatched action after render component with hooks (#14802)" (#14839) //<Dan Abramov>//
- **[6d4038f0a](facebook/react@6d4038f0a )**: [ShallowRenderer] Queue/rerender on dispatched action after render component with hooks (#14802) //<Rodrigo Ribeiro>//
- **[fa6205d52](facebook/react@fa6205d52 )**: Special case crossOrigin for SVG image elements (#14832) //<Brandon Dail>//
- **[c6bee765b](facebook/react@c6bee765b )**: Remove false positive warning and add TODOs about `current` being non-null (#14821) //<DanAbramov>//
- **[3ae94e188](facebook/react@3ae94e188 )**: Fix ignored sync work in passive effects (#14799) //<Dan Abramov>//
- **[f3a14951a](facebook/react@f3a14951a )**: Partial Hydration (#14717) //<Sebastian Markbåge>//

Changelog:

[GENERAL] [Changed] React sync for revisions f24a0da...22bb947

Reviewed By: gaearon

Differential Revision: D14160361

fbshipit-source-id: fffdc922f3ee5dfeeee656a8f213a6d3c03e8481
grabbou pushed a commit that referenced this pull request Feb 27, 2019
Summary:
This sync includes the following changes:

- **[8e25ed20b](facebook/react@8e25ed20b )**: Unify noop and test renderer assertion APIs (#14952) //<Andrew Clark>//
- **[870214f37](facebook/react@870214f37 )**: Deprecate ref.setNativeProps in favor of ReactNative.setNativeProps (#14912) //<Eli White>//
- **[3989c0950](facebook/react@3989c0950 )**: eslint-plugin-react-hooks@1.3.0 //<Dan Abramov>//
- **[1bbfbc98d](facebook/react@1bbfbc98d )**: [ESLint] Add more cases to exhaustive-deps rule (#14930) //<Dan Abramov>//
- **[412f88296](facebook/react@412f88296 )**: fix(eslint-plugin-react-hooks): node engine updated to version 7 because of object.entries(#14951) //<Farhad Yasir>//
- **[ba708fa79](facebook/react@ba708fa79 )**: Remove ReactNoop.flushDeferredPri and flushUnitsOfWork (#14934) //<Andrew Clark>//
- **[920b0bbb3](facebook/react@920b0bbb3 )**: [scheduler] Pass didTimeout argument to callbacks (#14931) //<Andrew Clark>//
- **[f99fca3cb](facebook/react@f99fca3cb )**: Fix sample ESLint configuration (#14926) //<Matt Thomson>//
- **[22bb94764](facebook/react@22bb94764 )**: Release eslint-plugin-react-hooks@1.2.0 //<Dan Abramov>//
- **[a77bbf1a1](facebook/react@a77bbf1a1 )**: [ESLint] Warn against assignments from inside Hooks (#14916) //<Dan Abramov>//
- **[219ce8a9c](facebook/react@219ce8a9c )**: Fix tracing fixture (#14917) //<Dan Abramov>//
- **[8c1966590](facebook/react@8c1966590 )**: Release 16.8.3 //<Dan Abramov>//
- **[7de4d2391](facebook/react@7de4d2391 )**: Fix UMD builds by re-exporting the scheduler priorities (#14914) //<Dan Abramov>//
- **[d0318fb3f](facebook/react@d0318fb3f )**: Updating copyright headers, dropping the year (#14893) //<Nathan Hunzaker>//
- **[f978d5fde](facebook/react@f978d5fde )**: Fix warning message for new setNativeProps method. on -> with (#14909) //<Eli White>//
- **[b0f45c0fc](facebook/react@b0f45c0fc )**: Adding ReactNative.setNativeProps that takes a ref (#14907) //<Eli White>//
- **[4f4aa69f1](facebook/react@4f4aa69f1 )**: Adding setNativeProps tests for NativeMethodsMixin (#14901) //<Eli White>//
- **[b96b61dc4](facebook/react@b96b61dc4 )**: Use the canonical nativeTag for Fabric's setNativeProps (#14900) //<Eli White>//
- **[dab2fdbbb](facebook/react@dab2fdbbb )**: Add eslint-plugin-react-hooks/exhaustive-deps rule to check stale closure dependencies (#14636) //<Dan Abramov>//
- **[1493abd7e](facebook/react@1493abd7e )**: Deleted empty App.css (#14149) //<Josh R>//
- **[13645d224](facebook/react@13645d224 )**: Deal with fallback content in Partial Hydration (#14884) //<Sebastian Markbåge>//
- **[c506ded3b](facebook/react@c506ded3b )**: Don't discard render phase state updates with the eager reducer optimization (#14852) //<Dan Abramov>//
- **[0e67969cb](facebook/react@0e67969cb )**: Prompt to include UMD build artifact links in GitHub release (#14864) //<Brian Vaughn>//
- **[fad0842fd](facebook/react@fad0842fd )**: Release scripts documentation (#14863) //<Brian Vaughn>//
- **[ab7a67b1d](facebook/react@ab7a67b1d )**: Fix react-dom/server context leaks when render stream destroyed early (#14706) //<overlookmotel>//
- **[3e5556043](facebook/react@3e5556043 )**: Release 16.8.2 //<Dan Abramov>//
- **[dfabb77a9](facebook/react@dfabb77a9 )**: Include another change in 16.8.2 //<Dan Abramov>//
- **[c555c008b](facebook/react@c555c008b )**: Include component stack in 'act(...)' warning (#14855) //<Sunil Pai>//
- **[ff188d666](facebook/react@ff188d666 )**: Add React 16.8.2 changelog (#14851) //<Dan Abramov>//
- **[c4d8ef643](facebook/react@c4d8ef643 )**: Fix typo in code comment (#14836) //<Deniz Susman>//
- **[08e955435](facebook/react@08e955435 )**: Statically enable suspense/partial hydration flag in www (#14842) //<Sebastian Markbåge>//
- **[0e4135e8c](facebook/react@0e4135e8c )**: Revert "[ShallowRenderer] Queue/rerender on dispatched action after render component with hooks (#14802)" (#14839) //<Dan Abramov>//
- **[6d4038f0a](facebook/react@6d4038f0a )**: [ShallowRenderer] Queue/rerender on dispatched action after render component with hooks (#14802) //<Rodrigo Ribeiro>//
- **[fa6205d52](facebook/react@fa6205d52 )**: Special case crossOrigin for SVG image elements (#14832) //<Brandon Dail>//
- **[c6bee765b](facebook/react@c6bee765b )**: Remove false positive warning and add TODOs about `current` being non-null (#14821) //<DanAbramov>//
- **[3ae94e188](facebook/react@3ae94e188 )**: Fix ignored sync work in passive effects (#14799) //<Dan Abramov>//
- **[f3a14951a](facebook/react@f3a14951a )**: Partial Hydration (#14717) //<Sebastian Markbåge>//

Changelog:

[GENERAL] [Changed] React sync for revisions f24a0da...22bb947

Reviewed By: gaearon

Differential Revision: D14160361

fbshipit-source-id: fffdc922f3ee5dfeeee656a8f213a6d3c03e8481
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants