Uploaded index.android.bundle has a 0 B size in release artifacts and error stack traces are minified
See original GitHub issueOS:
- Windows
- MacOS
- Linux
Platform:
- iOS
- Android
SDK:
-
@sentry/react-native
-
react-native-sentry
SDK version: 1.3.1
react-native
version: 0.61.5
Init Code:
Sentry.init({
dsn: 'https://...@sentry.customdomain.com/...'
});
For some reason, the uploaded release artifact of index.android.bundle
gets uploaded to our Sentry instance with a size of 0 B. When clicking to download it, its contents are:
{"detail": "Internal Error", "errorId": "..."}
This happens only with Android. In the same repo, we tried cutting a release with Xcode and both artifacts (index.android.bundle
and index.android.bundle.map
) get uploaded successfully.
Not sure if it’s the cause, but in error stack traces we don’t get anything meaningful like files and source code lines. Instead, everything is minified.
Passing the debug flag to see the Sentry upload requests, all seem OK and the server responds with 200 OK. There are no errors.
Related issue filed against sentry
: https://github.com/getsentry/sentry/issues/17005
I opened this issue because I don’t believe this is a sentry
but a sentry-react-native
issue. iOS seems to work fine both in terms of uploaded artifacts as well as meaningful stack traces.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:14 (3 by maintainers)
yes. The 0B thing is specific to hermes bytecode, which is only relevant for android.
Just solved my issue, ended up being a configuration issue on our end rather than an issue with sentry/hermes.
We use MS AppCenter to build our RN app for Android, and use the feature to automatically manage incrementing the build number. not 100% sure how it works, but it doesn’t modify the
versionCode
written inandroid/app/build.gradle
. OurversionCode
was hardcoded to 2 inside build.gradle, and sentry uses the value inside the file to determine what version the sourcemaps are uploaded for.for example the app was being built with
build_number == 154
so issues reported to sentry from the sentry-sdk hadrelease = 1.3.0 (154)
. But sourcemaps were being uploaded for1.3.0 (2)
, so sentry couldn’t find them which makes sense.Here’s the code for the fix: