expo / sentry-expo

MIT License
202 stars 83 forks source link

Sentry.Native is no longer available? #372

Closed alaughlin closed 6 months ago

alaughlin commented 10 months ago

Summary

I am following the instructions on how to setup Sentry in my Expo app here: https://docs.expo.dev/guides/using-sentry/

I am importing the package like so: import * as Sentry from 'sentry-expo';

However, when I try to access Sentry.Native.* I am told there's no Native export at all. The docs (and many examples out there) state that it should be avaiable. All I am seeing exported from the package is init (which works fine), Browser, and React

What am I missing here?

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)

49.0.11

Environment

expo-env-info 1.0.5 environment info: System: OS: macOS 13.2.1 Shell: 5.8.1 - /bin/zsh Binaries: Node: 18.16.0 - ~/.nvm/versions/node/v18.16.0/bin/node npm: 9.5.1 - ~/.nvm/versions/node/v18.16.0/bin/npm SDKs: iOS SDK: Platforms: DriverKit 22.4, iOS 16.4, macOS 13.3, tvOS 16.4, watchOS 9.4 IDEs: Xcode: 14.3.1/14E300c - /usr/bin/xcodebuild npmPackages: @expo/webpack-config: ^19.0.0 => 19.0.0 expo: ^49.0.11 => 49.0.11 react: 18.2.0 => 18.2.0 react-dom: 18.2.0 => 18.2.0 react-native: 0.72.4 => 0.72.4 react-native-web: ~0.19.6 => 0.19.9 npmGlobalPackages: eas-cli: 5.3.0 Expo Workflow: managed

Reproducible demo or steps to reproduce from a blank project

import * as Sentry from 'sentry-expo';

Sentry.Native.captureException('error');
krystofwoldrich commented 10 months ago

Hi, could you share a minimal reproducible example?

The Native is exported here and then reexported in index.ts

alexvancap commented 10 months ago

Hi, I have the same problem, we switched to @sentry/react-native for now and that works fine.

krystofwoldrich commented 9 months ago

@alexvancap Thanks for the info. Happy to hear @sentry/react-native works for you.

Would you be able to share a minimal reproducible example for the sentry-expo?

sem4phor commented 9 months ago

From the issue description it sounds that @alaughlin only has the issue that the editor resolves to sentry.web.d.ts where no Native is exported instead of sentry.d.ts where it is exported I think thats why people are complaining...

Thats not really a bug as when u log it on a native device the Native Property is present. Of couse editor support would be great :)

krystofwoldrich commented 8 months ago

Thank you for pointing it out @sem4phor

This issue can be closed.

github-actions[bot] commented 6 months ago

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[bot] commented 6 months ago

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.

krystofwoldrich commented 6 months ago

Hello everyone, @sentry/react-native now supports Expo out of the box!

In the new package the Sentry.Native.* is just Sentry.*.

Update to https://github.com/getsentry/sentry-react-native/releases/tag/5.16.0 or newer to get all the new features.

Migration guides available: