expo / sentry-expo

MIT License
202 stars 83 forks source link

Missing documentation for SourceMaps with `eas build` #366

Closed jamesBrennan closed 10 months ago

jamesBrennan commented 1 year ago

Summary

In the documentation for SourceMaps there are specific instructions for using eas publish, eas export, and eas update. There is no mention of eas build.

Currently we are in private beta and we're pushing test releases with eas build -p android --profile production --auto-submit. It is unclear to me which, if any, of the documentation applies to our situation.

Since we're bare, I know we need to use sentry-wizard as part of the process. Currently we're running that as a eas-build-post-install hook. I'm pretty sure that's not correct, but I don't know where the right place for it is.

It would be great if the docs were a little more robust. In the meantime any/all help is greatly appreciated. (I'd be happy to update the docs myself, once I understand what is going on).

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

bare

What platform(s) does this occur on?

Android, iOS

SDK Version (managed workflow only)

No response

Environment

expo-env-info 1.0.5 environment info: System: OS: macOS 12.6.3 Shell: 5.8.1 - /bin/zsh Binaries: Node: 16.14.0 - ~/.nodenv/versions/16.14.0/bin/node Yarn: 1.22.19 - ~/.nodenv/versions/16.14.0/bin/yarn npm: 8.3.1 - ~/.nodenv/versions/16.14.0/bin/npm Watchman: 2023.08.07.00 - /opt/homebrew/bin/watchman Managers: CocoaPods: 1.11.3 - /Users//.rvm/gems/ruby-3.0.0/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0 IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild npmPackages: expo: ^49.0.0 => 49.0.7 react: 18.2.0 => 18.2.0 react-native: 0.72.3 => 0.72.3 npmGlobalPackages: eas-cli: 4.1.2 Expo Workflow: bare

Reproducible demo or steps to reproduce from a blank project

This is primarily a request to expand the documentation.

colinux commented 1 year ago

I have the same kind of issue and would love an updated documentation. (I'm developing an expo app with sentry since ~6 years, and since EAS and hermes advent (for the good !), I have a bad sentry experience due to source maps issues or missing, and post publish hook not working as expected.)

Currently I have to do an eas update after the build was deployed (which is weird). I'm noting the iOS and Android release uuids, rename the source files (in dist/bundles) to main.jsbundle, main.jsbundle.map, index.android.bundle, index.android.bundle.map then upload it manually :

node_modules/@sentry/cli/bin/sentry-cli releases files $appVersion upload-sourcemaps --strip-prefix /path/to/my/root/app --dist $iOSReleaseUUID  dist/bundles/main.jsbundle.map dist/bundles/main.jsbundle
node_modules/@sentry/cli/bin/sentry-cli releases files $appVersion upload-sourcemaps --strip-prefix /path/to/my/root/app --dist $androidReleaseUUID  dist/bundles/index.android.bundle.map dist/bundles/index.android.bundle

It's probably not optimal because I sill have some issues or releases which do not have a good JS trace.

brentvatne commented 1 year ago

some context - @krystofwoldrich and @kbrandwijk are currently working on merging sentry-expo into @sentry/react-native, so there isn't a lot of development going on in this particular repository.

when it comes to using sentry-expo with EAS Build, you don't need any additional configuration. if you set up the config plugin correctly and set the SENTRY_AUTH_TOKEN, SENTRY_ORG, and SENTRY_PROJECT environment variables (use a secret for the auth token, you can for others too if you want), then your source maps will be automatically uploaded when the build is completed.

Jonatthu commented 1 year ago

@brentvatne I noticed expo-router does not generate source maps metadata at all, Am I not understanding something? I can not find any path related to expo router

github-actions[bot] commented 10 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 10 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 8 months ago

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

You can upload source maps for EAS Update as easily as npx sentry-expo-upload-sourcemaps dist. And native builds source maps uploads are now configured using @sentry/react-native/expo.

{
  "expo": {
    "plugins": [
      [
        "@sentry/react-native/expo",
        {
          "url": "https://sentry.io/",
          "warning": "DO NOT COMMIT YOUR AUTH TOKEN",
          "authToken": "Click to generate token",
          "project": "android",
          "organization": "demo"
        }
      ]
    ]
  }
}

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: