Hermes, sentry source map is showing wrong code in both codepush and production build, but not when running in dev
See original GitHub issueEnvironment
- How do you use Sentry?
self-hosted Sentry 21.4.037b2bca
- Which SDK and version?
@sentry/react-native
: 3.1.1
Steps to Reproduce
git clone https://github.com/pass-culture/pass-culture-app-native.git
cd pass-culture-app-native
nvm use
yarn
- Source this file https://github.com/pass-culture/pass-culture-app-native/blob/master/scripts/upload_sourcemaps_to_sentry.sh#L7-L35 with
. scripts/upload_sourcemaps_to_sentry.sh
, this follow the step to generate sentry source map for react native with hermes - upload the source map to sentry using the same script
- generate an error like in here: https://github.com/pass-culture/pass-culture-app-native/blob/master/src/features/cheatcodes/pages/Navigation/Navigation.tsx#L86-L92
Expected Result
I expect to see the error in sentry with the source maps showing the proper code, like when I run the app in __DEV__
,
Actual Result
Production build does show some unexpected source map for the same error :
When I check the minified
version, we can clearly see that the error happen in onPress
:
This is the same error with Android
:
Again we clearly see that the error is in onPress
:
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:43 (17 by maintainers)
Top Results From Across the Web
React Native Hermees source maps showing wrong code
Hello everyone, I use Sentry, react native and hermes. I have build the source map using this script : SOURCEMAPS_DIR="sourcemaps" ...
Read more >Troubleshooting for JavaScript | Sentry Documentation
In case the source map files do not contain your original source code ( sourcesContent ), you must additionally provide the original source...
Read more >Sentry React-Native with CodePush not using source maps
I'm using CodePush to upload my app and I want Sentry to handle my errors since the appcenter diagnostics are not very good....
Read more >@sentry/cli | Yarn - Package Manager
Upon sourcemap uploading the sentry-cli tool is now automatically attempting to find matching sourcemaps and emit a Sourcemap header with the correct reference....
Read more >Sentry React-Native with CodePush not using source maps ...
export SENTRY_PROPERTIES=./ios/sentry.properties sentry-cli react-native appcenter \ account/project \ ios ./build/codePush \ --release-name "1.0" \ --dist ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kopax-polyconseil @marandaneto I apologize for the delay, I finally finished my finals.
Anyways, I’ve reproduced the issue with the bad source maps, however, I found that if I use the source maps that are automatically generated by our react native build scripts those work perfectly. Upon further investigation I found that the bundle output from the build script is correct, however when you manually run the bundle command, the output is not the same.
I will need some time to investigate this further.
@kopax-polyconseil For iOS, I just tried on your reproduction, you will want to upload the original bundle.
I am not able to test with code push right now, but I would assume it would use the original bundle as well.
This is very unexpected behavior and is not consistent with how it was previously…I will get to the bottom of this.