bugsnag / bugsnag-react-native

Error monitoring and reporting tool for native exceptions and JS errors in React Native apps
https://docs.bugsnag.com/platforms/react-native
MIT License
370 stars 121 forks source link

Upload Hermes sourcemaps generated by CodePush #463

Closed rcstanciu closed 4 years ago

rcstanciu commented 4 years ago

Description

Currently, on each OTA update using CodePush, I have to trigger an Android full build in order to generate the Hermes bundle & sourcemaps, found in android/app/build/generated/assets/react/release/index.android.bundle and android/app/build/generated/sourcemaps/react/release/index.android.bundle.map as stated in the docs: https://docs.bugsnag.com/platforms/react-native/react-native/showing-full-stacktraces/#uploading-hermes-source-maps

As CodePush generates the JS bundle, as well as the Hermes byte-code bundle and sourcemaps, is there any way we can use these instead of those generated by the Android build?

Issue

I tried uploading CodePush's Hermes byte-code bundle and sourcemap to Bugsnag, I did not get any errors like "Unable to apply sourcemap", but the stacktrace is gibberish:

Screenshot 2020-06-23 at 23 13 24

Environment

Library versions:

yarn list v1.22.4
├─ bugsnag-react-native@2.23.8
├─ react-native-code-push@6.2.0
└─ react-native@0.62.2
xljones commented 4 years ago

Hey @rcstanciu, it's a known 'issue' with the CodePush / Hermes combo. The Hermes map is rendered in a binary format when produced through CodePush which is what you're seeing here.

Hopefully when the issue we raised here https://github.com/facebook/hermes/issues/85 is resolved, we'll be able to take a look into whether we can use the CodePush output files. In the meantime, what you were doing before with the Android build is correct!