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.deviceContexts is undefined [Android] #1050

Closed
5 of 11 tasks
AdamGerthel opened this issue Sep 1, 2020 · 4 comments
Closed
5 of 11 tasks

RNSentry.deviceContexts is undefined [Android] #1050

AdamGerthel opened this issue Sep 1, 2020 · 4 comments

Comments

@AdamGerthel
Copy link

AdamGerthel commented Sep 1, 2020

OS:

  • Windows
  • MacOS
  • Linux

Platform:

  • iOS
  • Android

SDK:

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

SDK version: 1.7.2
react-native version: 0.63.2

Are you using Expo?

  • Yes
  • No

Are you using sentry.io or on-premise?

  • sentry.io (SaaS)
  • on-premise

Configuration:

(@sentry/react-native)

  Sentry.init({
    dsn: config.sentry.dsn,
    debug: __DEV__ ? true : false
  })

I have following issue:

When logging errors, for example using Sentry.captureException, I'm getting the following error/warning:

Sentry Logger [Log]: Failed to get device context from native: TypeError: RNSentry.deviceContexts is not a function. (In 'RNSentry.deviceContexts()', 'RNSentry.deviceContexts' is undefined)

Steps to reproduce:

  1. Create new project npx react-native init AwesomeProject
  2. Install Sentry yarn add @sentry/react-native
  3. Open app.js and add the following:
import * as Sentry from "@sentry/react-native";

Sentry.init({
  dsn: "__DSN__" // My DSN hidden here
});

Sentry.captureMessage("Hello Sentry!");
  1. Run on device or emulator yarn run android

You can optionally also run npx sentry-wizard -i reactNative -p android to run the Sentry Wizard, but even after running the Wizard (thus adding settings and updating android/app/build.gradle) the issue persists.

Actual result:
I'm getting a warning about RNSentry.deviceContexts being undefined:

[Wed Sep 02 2020 08:16:27.839] LOG Sentry Logger [Log]: Integration installed: ReactNativeErrorHandlers
[Wed Sep 02 2020 08:16:27.876] LOG Sentry Logger [Log]: Integration installed: Release
[Wed Sep 02 2020 08:16:27.879] LOG Sentry Logger [Log]: Integration installed: InboundFilters
[Wed Sep 02 2020 08:16:27.881] LOG Sentry Logger [Log]: Integration installed: FunctionToString
[Wed Sep 02 2020 08:16:27.883] LOG Sentry Logger [Log]: Integration installed: Breadcrumbs
[Wed Sep 02 2020 08:16:27.884] LOG Sentry Logger [Log]: Integration installed: LinkedErrors
[Wed Sep 02 2020 08:16:27.886] LOG Sentry Logger [Log]: Integration installed: UserAgent
[Wed Sep 02 2020 08:16:27.887] LOG Sentry Logger [Log]: Integration installed: DebugSymbolicator
[Wed Sep 02 2020 08:16:27.888] LOG Sentry Logger [Log]: Integration installed: RewriteFrames
[Wed Sep 02 2020 08:16:27.890] LOG Sentry Logger [Log]: Integration installed: DeviceContext
[Wed Sep 02 2020 08:16:28.410] LOG Sentry Logger [Log]: Failed to get device context from native: TypeError: RNSentry.deviceContexts is not a function. (In 'RNSentry.deviceContexts()', 'RNSentry.deviceContexts' is undefined)

Expected result:
That I don't get the error :D

@AdamGerthel AdamGerthel changed the title RNSentry.deviceContexts' is undefined [Android] RNSentry.deviceContexts is undefined [Android] Sep 1, 2020
@AdamGerthel
Copy link
Author

Updated with reproducible example

@jennmueng
Copy link
Member

@AdamGerthel Thanks! I am able to reproduce this. Will look into it ASAP.

@matt-pawley
Copy link

Also having this issue on Android with latest Sentry/React Native packages:

@sentry/react-native": "^1.7.2
"react-native": "^0.63.2"

Can see a PR is open, do we have any idea when this might get merged and released? Thanks

@jennmueng
Copy link
Member

@toughdeveloper It just got merged and we should have a release shorty!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants