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

RNSentry.m:64:38: too many arguments to block call, expected 1, have 3 #895

Closed
5 of 11 tasks
takagisou opened this issue Jun 3, 2020 · 11 comments
Closed
5 of 11 tasks

Comments

@takagisou
Copy link

takagisou commented Jun 3, 2020

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

  • @sentry/react-native (>= 1.0.0)
  • react-native-sentry (<= 0.43.2)

SDK version: 1.4.2

react-native version: 0.59.10

$ react-native -v
react-native-cli: 2.0.1
react-native: 0.59.10

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

If you are using sentry.io, please post a link to your issue so we can take a look:

[Link to issue]

Configuration:

(@sentry/react-native)

Sentry.init({ 
  dsn: '',
});

I have following issue:

Build failed.

Steps to reproduce:

  • react-native run-ios

Actual result:

▸ Running script 'Start Packager'
▸ Running script 'Include RCTJSCProfiler'
▸ Compiling RNSentry.m

❌  /Users/me/src/my-app/node_modules/@sentry/react-native/ios/RNSentry.m:64:38: too many arguments to block call, expected 1, have 3

        reject(@"SentryReactNative", error.localizedDescription, error);
        ~~~~~~                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~



❌  /Users/me/src/my-app/node_modules/@sentry/react-native/ios/RNSentry.m:130:42: too many arguments to block call, expected 1, have 3

            reject(@"SentryReactNative", @"Cannot serialize event", nil);
            ~~~~~~                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


    Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings are configured correctly for the iOS Simulator platform. (in target 'RCTOneSignal' from project 'RCTOneSignal')

Expected result:

Run on simulator

@AndreTsao
Copy link

have you solved it?Thanks

@takagisou
Copy link
Author

@JetCyC not yet.

@HazAT
Copy link
Member

HazAT commented Jun 3, 2020

@takagisou This issue seems very odd, react-native changed the signature of this function 4 years ago.
facebook/react-native@0c5f279

Are you using any other library that patches this?

@HazAT
Copy link
Member

HazAT commented Jun 3, 2020

@JetCyC I want to remind you about our CoC https://github.com/getsentry/.github/blob/master/CODE_OF_CONDUCT.md
We are here to help our users the best as we can, non-constructive comments like yours will no be tolerated, consider this a warning.

@getsentry getsentry deleted a comment from AndreTsao Jun 3, 2020
@takagisou
Copy link
Author

@HazAT
Thank you for replying.

Are you using any other library that patches this?

I'm not sure because I recently joined the ReactNative project.

I'm using "react-native-sentry": "0.42.0" and it happened during the transition to "@sentry/react-native" with the following reference.

https://docs.sentry.io/platforms/react-native/

I will do a little more research.

@HazAT
Copy link
Member

HazAT commented Jun 4, 2020

@takagisou I really don't understand, we are using this reject method
https://github.com/facebook/react-native/blob/0.42-stable/React/Base/RCTBridgeModule.h#L40

it has 3 arguments and this is the reference to version 0.42

@takagisou
Copy link
Author

@HazAT

I'm not very familiar with ReactNative...

React Native version as follow.

$ react-native -v
react-native-cli: 2.0.1
react-native: 0.59.10

Podfile.lock

PODS:
  - GoogleSignIn (4.3.0):
    - "GoogleToolboxForMac/NSDictionary+URLArguments (~> 2.1)"
    - "GoogleToolboxForMac/NSString+URLArguments (~> 2.1)"
    - GTMOAuth2 (~> 1.0)
    - GTMSessionFetcher/Core (~> 1.1)
  - GoogleToolboxForMac/DebugUtils (2.2.1):
    - GoogleToolboxForMac/Defines (= 2.2.1)
  - GoogleToolboxForMac/Defines (2.2.1)
  - "GoogleToolboxForMac/NSDictionary+URLArguments (2.2.1)":
    - GoogleToolboxForMac/DebugUtils (= 2.2.1)
    - GoogleToolboxForMac/Defines (= 2.2.1)
    - "GoogleToolboxForMac/NSString+URLArguments (= 2.2.1)"
  - "GoogleToolboxForMac/NSString+URLArguments (2.2.1)"
  - GTMOAuth2 (1.1.6):
    - GTMSessionFetcher (~> 1.1)
  - GTMSessionFetcher (1.2.2):
    - GTMSessionFetcher/Full (= 1.2.2)
  - GTMSessionFetcher/Core (1.2.2)
  - GTMSessionFetcher/Full (1.2.2):
    - GTMSessionFetcher/Core (= 1.2.2)
  - React (0.11.0):
    - React/Core (= 0.11.0)
  - React/Core (0.11.0)
  - RNSentry (1.4.2):
    - React
    - Sentry (~> 5.1.1)
  - Sentry (5.1.1):
    - Sentry/Core (= 5.1.1)
  - Sentry/Core (5.1.1)

DEPENDENCIES:
  - GoogleSignIn (~> 4.3.0)
  - "RNSentry (from `../node_modules/@sentry/react-native`)"

SPEC REPOS:
  https://github.com/CocoaPods/Specs.git:
    - GoogleSignIn
    - GoogleToolboxForMac
    - GTMOAuth2
    - GTMSessionFetcher
  trunk:
    - React
    - Sentry

EXTERNAL SOURCES:
  RNSentry:
    :path: "../node_modules/@sentry/react-native"

SPEC CHECKSUMS:
  GoogleSignIn: 11183592dc63e105475c7305a325045ff95e02b7
  GoogleToolboxForMac: b3553629623a3b1bff17f555e736cd5a6d95ad55
  GTMOAuth2: e8b6512c896235149df975c41d9a36c868ab7fba
  GTMSessionFetcher: 61bb0f61a4cb560030f1222021178008a5727a23
  React: ab1a2e21deb34965c38328d5ec40cc7d12c6050a
  RNSentry: c4bdecef182912b8d8bb5b626f45da314f047dbd
  Sentry: a8e37dc33aedb8a53540e36607fc2eaef7c31b4f

PODFILE CHECKSUM: 5e2bafbc45a648acb0e86e46e657665eede9abe4

COCOAPODS: 1.9.0

Pods > React > Core > RCTBridgeModule.h

/**
 * Block that bridge modules use to reject the JS promise waiting for a result.
 * The error may be nil but it is preferable to pass an NSError object for more
 * precise error messages.
 */
typedef void (^RCTPromiseRejectBlock)(NSError *error);

Thank you.

@HazAT
Copy link
Member

HazAT commented Jun 5, 2020

OK so that is the problem, your react-native React (0.11.0) version is 4 years old and we don't support it.
It will be hard to add support for this, I am not even sure if we ever supported this version.

So I am closing this, solution is upgrading to a new react-native version.

@HazAT HazAT closed this as completed Jun 5, 2020
@eyaydin
Copy link

eyaydin commented Jun 8, 2020

Hello,

@HazAT you are right the version that is being referenced (0.11.0) is wrong but the thing is this old version is being added to the project automatically after running react-native link @sentry/react-native followed by pod install in ios folder.

And at the same time, metro gives this error:

UnhandledPromiseRejectionWarning: Error: jest-haste-map: Haste module naming collision: Duplicate module name: react-native Paths: /Users/.../.../.../.../ios/Pods/React/package.json collides with /Users/.../.../.../.../node_modules/react-native/package.json

Not sure why React 0.11.0 is being added to the project with the Sentry.

Any help would be appreciated.

@eyaydin
Copy link

eyaydin commented Jun 9, 2020

Can we reopen this issue 😕

@eyaydin
Copy link

eyaydin commented Jun 9, 2020

I updated RNSentry.podspec to look for specifically my installed version of React. i.e:
s.dependency 'React' to s.dependency 'React', '0.59.10'. When I do this the Podfile.lock sees React and React related dependencies as 0.59.10. This approach successfully builds but fails when I try to run because of duplicate resources. i.e:

Class RCTWebSocketModule is implemented in both /Users/.../Library/Developer/CoreSimulator/Devices/90D0534D-6CED-42AC-9B6E-218E2B603ABC/data/Containers/Bundle/Application/290ADA55-F4BB-4D47-86DD-D4352C218625/ivynative.app/Frameworks/React.framework/React (0x102c44a30) and /Users/.../Library/Developer/CoreSimulator/Devices/90D0534D-6CED-42AC-9B6E-218E2B603ABC/data/Containers/Bundle/Application/290ADA55-F4BB-4D47-86DD-D4352C218625/ivynative.app/ivynative (0x1025daab8). One of the two will be used. Which one is undefined.

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

4 participants