MindscapeHQ / raygun4reactnative

ReactNative crash reporting SDK for Raygun
MIT License
3 stars 3 forks source link

Promise finally error when disableUnhandledPromiseRejectionReporting: false setting enabled in Apollo Client networking code. #42

Closed oleksandr-dziuban closed 2 years ago

oleksandr-dziuban commented 3 years ago

There is an error on latest react-native@0.64.0 with enabled hermes engine on iOS and installed raygun4reactnative@1.1.0 according to docs. Also I use @apollo/client@3.3.13 for networking.

When option to catch unhandled promise rekection disableUnhandledPromiseRejectionReporting: false is enabled Apollo Client code throws errors:

js engine: hermes
 WARN  0 [TypeError: undefined is not a function]
 WARN  1 [TypeError: undefined is not a function]
 WARN  2 [TypeError: undefined is not a function]
 WARN  [TypeError: undefined is not a function]
 WARN  3 [TypeError: undefined is not a function]
 WARN  4 [TypeError: undefined is not a function]
 WARN  5 [TypeError: undefined is not a function]
 WARN  6 [TypeError: undefined is not a function]
 WARN  7 [TypeError: undefined is not a function]
 WARN  8 [TypeError: undefined is not a function]
 WARN  9 [TypeError: undefined is not a function]
 WARN  10 [TypeError: undefined is not a function]
 WARN  11 [TypeError: undefined is not a function]
 WARN  12 [TypeError: undefined is not a function]
 WARN  13 [TypeError: undefined is not a function]
 WARN  14 [TypeError: undefined is not a function]
 WARN  15 [TypeError: undefined is not a function]
 WARN  16 [TypeError: undefined is not a function]
 WARN  17 [TypeError: undefined is not a function]
 WARN  18 [TypeError: undefined is not a function]
 WARN  19 [TypeError: undefined is not a function]
 WARN  20 [TypeError: undefined is not a function]
 WARN  21 [TypeError: undefined is not a function]
 WARN  22 [TypeError: undefined is not a function]
 WARN  23 [TypeError: undefined is not a function]
 WARN  24 [TypeError: undefined is not a function]
 WARN  25 [TypeError: undefined is not a function]
 WARN  26 [TypeError: undefined is not a function]
 WARN  27 [TypeError: undefined is not a function]
 WARN  28 [TypeError: undefined is not a function]

When I set disableUnhandledPromiseRejectionReporting: true everything is OK.

Setup:

RaygunClient.init({
    apiKey: 'API_KEY',
    version: '2.0.0',
    enableCrashReporting: true,
    disableNativeCrashReporting: false,
    disableUnhandledPromiseRejectionReporting: false,
    enableRealUserMonitoring: true,
    disableNetworkMonitoring: true,
  });

RaygunClient.setUser({ identifier: 'test', isAnonymous: true });
RaygunClient.sendError(new Error('Test Error'));
oleksandr-dziuban commented 3 years ago

@MindscapeBot Please check

balovbohdan commented 3 years ago

Take a look, please. I faced the same issue.

oleksandr-dziuban commented 3 years ago

@MindscapeBot Looks like issue in disableUnhandledPromiseRejectionReporting: false setting. If I disable it with disableUnhandledPromiseRejectionReporting: true - everuything works fine on all platforms, engines. So I just noticed that Apollo client for GraphQL calls throws this error. Looks like JS Promises finally function is not available with disableUnhandledPromiseRejectionReporting: false. Apollo Client uses finally callback in it's API. Will rename issue.

mduncan26 commented 3 years ago

Hi @oleksandr-dziuban

This issue may now be resolved with the release of v1.1.3 of the raygun4reactnative SDK. Please try updating and let us know if this issue continues.

Thank you, Mitchell

mduncan26 commented 3 years ago

I believe this issue has been resolved in v1.1.3 of the SDK, so I will close this issue for now.

Please comment on this thread if you are able to reproduce the issue after updating to v1.1.3+.

Widdershin commented 2 years ago

Reopening as we've been able to reproduce this issue on the latest release.