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

SentryError: Native is disabled #230

Closed
annasychugina opened this issue Jan 3, 2022 · 11 comments
Closed

SentryError: Native is disabled #230

annasychugina opened this issue Jan 3, 2022 · 11 comments
Labels

Comments

@annasychugina
Copy link

annasychugina commented Jan 3, 2022

Summary

I have installed @sentry/react-native and added in plugins 'sentry-expo' according to guide https://docs.expo.dev/guides/using-sentry/

When I use Sentry.Native.* methods (Sentry.Native.crash, captureExeption and etc), I get error:

[Unhandled promise rejection: SentryError: Native is disabled]
at http://127.0.0.1:19000/src/index.mobile.ts.bundle?platform=ios&dev=true&hot=false&minify=false:233787:25 in new SentryError
at node_modules/sentry-expo/node_modules/@sentry/react-native/dist/js/wrapper.js:10:22 in <global>
at node_modules/metro-runtime/src/polyfills/require.js:349:4 in loadModuleImplementation
at node_modules/metro-runtime/src/polyfills/require.js:210:11 in guardedLoadModule
at node_modules/metro-runtime/src/polyfills/require.js:128:6 in metroRequire
at http://127.0.0.1:19000/src/index.mobile.ts.bundle?platform=ios&dev=true&hot=false&minify=false:246107:17 in <unknown>
at node_modules/metro-runtime/src/polyfills/require.js:349:4 in loadModuleImplementation
at node_modules/metro-runtime/src/polyfills/require.js:210:11 in guardedLoadModule
at node_modules/metro-runtime/src/polyfills/require.js:128:6 in metroRequire
at http://127.0.0.1:19000/src/index.mobile.ts.bundle?platform=ios&dev=true&hot=false&minify=false:246073:28 in <unknown>

Related issues: 226

Managed or bare workflow? If you have ios/ or android/ directories in your project, the answer is bare!

managed

What platform(s) does this occur on?

iOS

SDK Version (managed workflow only)

43

Environment

  Expo CLI 4.5.2 environment info:
    System:
      OS: macOS 10.15.7
      Shell: 5.7.1 - /bin/zsh
    Binaries:
      Node: 14.17.6 - /usr/local/bin/node
      Yarn: 1.22.10 - /usr/local/bin/yarn
      npm: 6.14.15 - /usr/local/bin/npm
      Watchman: 4.9.0 - /usr/local/bin/watchman
    SDKs:
      iOS SDK:
        Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    IDEs:
      Android Studio: 4.1 AI-201.8743.12.41.7042882
      Xcode: 12.4/12D4e - /usr/bin/xcodebuild
    npmPackages:
      expo: ^43.0.2 => 43.0.2 
      react: 17.0.1 => 17.0.1 
      react-dom: 17.0.1 => 17.0.1 
      react-native: 0.64.3 => 0.64.3 
      react-native-web: 0.17.1 => 0.17.1 
    npmGlobalPackages:
      expo-cli: 4.5.2
    Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

Happens consistently after using this library

@annasychugina annasychugina changed the title Error: SentryError: Native is disabled SentryError: Native is disabled Jan 3, 2022
@maticzav
Copy link

Is there any progress with this issue or at least a suggested an alternative approach to adding Sentry to our Expo projects?

@rthbrst
Copy link

rthbrst commented Feb 17, 2022

I experienced the same issue using SDK 44 after migrating from the classic build to EAS just recently. Sentry seemed not to be linked into the build as it would not show up in the logs from EAS.

I added "@sentry/react-native": "^3.2.13" to my project's package.json, executed yarn install and created a new build using EAS. Now Sentry would be linked correctly so I assume there is some kind of linking issue with the @sentry/react-native version which is currently used by sentry-expo.

After a quick test with the development client on iOS it seems Sentry.Native.capture*() as well as Sentry.Native.setUser() would all work perfectly fine again with this setup. I haven't tested it extensively or in a production build yet though, so I can't say for sure that there are no compatibility issues.

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Jul 19, 2022
@mprevdelta
Copy link

I experienced the same issue using SDK 44 after migrating from the classic build to EAS just recently. Sentry seemed not to be linked into the build as it would not show up in the logs from EAS.

I added "@sentry/react-native": "^3.2.13" to my project's package.json, executed yarn install and created a new build using EAS. Now Sentry would be linked correctly so I assume there is some kind of linking issue with the @sentry/react-native version which is currently used by sentry-expo.

After a quick test with the development client on iOS it seems Sentry.Native.capture*() as well as Sentry.Native.setUser() would all work perfectly fine again with this setup. I haven't tested it extensively or in a production build yet though, so I can't say for sure that there are no compatibility issues.

I experienced this issue too and realized I was missing that addition to package.json. The docs do state it but it's kinda unexpected that we'd need to add this dependency by hand. The docs state:

"
sentry-expo requires some additional dependencies, so you should also run:
'expo install expo-application expo-constants expo-device expo-updates @sentry/react-native'
"

@github-actions github-actions bot removed the stale label Jul 22, 2022
@calebguy
Copy link

calebguy commented Aug 10, 2022

still seeing this issue running

@sentry/react-native@4.2.2

expo@46.0.0

sentry-expo@5.0.2

reproducible example here https://github.com/calebcarithers/test-sentry

steps to reproduce
1: yarn
2: yarn ios
3: Click 'crash' button

Screen Shot 2022-08-10 at 12 08 40

@kbrandwijk
Copy link
Contributor

yarn ios will load your app in Expo Go. While Sentry works for JS errors, @sentry/react-native has native dependencies, so this requires you to create a development build to be able to use native crash reporting. A note about that is also in the docs here: https://docs.expo.dev/guides/using-sentry/, so this warning is expected in Expo Go.
image

@calebguy
Copy link

Ah okay - understood - thanks @kbrandwijk

@calebguy
Copy link

calebguy commented Aug 10, 2022

@kbrandwijk is there a recommendation for getting crash reports while using Expo Go? Attempting to log crashes while testing via EAS Update previews

@jetaggart
Copy link

@kbrandwijk is there a recommended way to test this locally with expo go?

@github-actions
Copy link

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

@github-actions github-actions bot added the stale label Nov 30, 2022
@github-actions
Copy link

github-actions bot commented Dec 7, 2022

This issue was closed because it has been inactive for 7 days since being marked as stale. Please open a new issue if you believe you are encountering a related problem.

@github-actions github-actions bot closed this as completed Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

7 participants