sentry-react-native: Source code was not found 1.3.0 (iOS & Android)
OS:
- Windows
- MacOS
- Linux
Platform:
- iOS
- Android
SDK:
-
@sentry/react-native
-
react-native-sentry
react-native
version: 0.61.2
SDK version: 1.3.0
Init Code:
Sentry.init({
dsn: 'https://...@sentry.io/...'
});
I have the following issue:
After update today from 1.2.2 to 1.3.0 with Hermes support, I ran iOS build in release mode and added following line to create crash:
throw new Error ('New Sentry!')
I ran assembleRelease for android and then regular build with the error.
Steps to reproduce:
- yarn add @sentry/react-native@latest
- pod install (it updated sentry/react-native to 1.3.0)
- watchman watch-del-all && rm -f yarn.lock && rm -rf node_modules && yarn && yarn start --reset-cache
Actual result:
I don’t see sourcemaps for iOS anymore.
I don’t see sourcemaps for android, but 1.3.0 sees Hermes engine.
Expected result: I would like to be able to see the source of error for ios and android.
Thank you!
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 7
- Comments: 67 (25 by maintainers)
Still doesn’t look too good.
The link I posted above looks like this:
You are missing the third step to combine the two intermediate sourcemaps? If you then provide the resulting binary bytecode and combined sourcemap to
sentry-cli
, that should upload the correct things and result in a0B
file, as mentioned above.@valeriashpiner I looked at your issues. I am not really sure what’s happening on Android, it seems to be correct but the source map on the server isn’t applied correctly. It seems to be a bug on the server because the bundle and source map look correctly.
@valeriashpiner the same issue @sentry/react-native 1.3.3 iOS I have seen the source map at Artifacts , but the sentry server tell me ‘source code was not found’
ref: https://github.com/getsentry/symbolic/pull/189
@christianbach same for me, can’t get sourcemaps on Android, iOS seems to be fine.
@valeriashpiner for us it works as expected on iOS. We are only seeing this issue on Android with Hermes
1.3.1
has been released, fixing the iOS issue.Any solution on Android? I have @sentry/react-native 1.3.7 version and still
and artifacts
Update: Upgrading to latest SDK 1.3.3 fixed the stacktrace and we stopped getting the above error about the missing source code.
We can finally see exactly which line failed and why.
We do everything manually using fastlane and sentry-fastlane-plugin. Everything works as expected on iOS and Android (using JSC). When we switch to using Hermes on Android source maps are lost…
@HazAT Yes, I made it like this:
react-native bundle \ --dev false \ --platform android \ --entry-file index.js \ --bundle-output index.android.bundle \ --sourcemap-output index.android.bundle.map
and then this:
node_modules/@sentry/cli/bin/sentry-cli --auth-token **[token]** releases --org **[org name]** --project android-app files **[release name]** upload-sourcemaps --dist 3123 --strip-prefix index.js --rewrite index.android.bundle.map index.android.bundle
so far I see bundles in artifacts and Sentry doesn’t complain anymore. as soon as we will receive crash in release mode from users, I will know does it work correctly or not.
https://github.com/getsentry/sentry-cli/pull/660
There is a small bug in iOS right now, we are working on a fix. It sets the wrong release name by default.
@marandaneto Source maps get uploaded just fine for me now on both Android and iOS. Running hermes for both
iOS
andAndroid
onreact-native: "0.66.1"
and@sentry/react-native": "3.1.1"
I believe it got fixed in version@sentry/react-native": "2.5.0
but don’t trust my word on this one.@v-anton it’s expected behaviour with hermes engine on.
Make sure your ~/index.android.bundle.map is there and doesn’t equal to 0B.
Hi @HazAT , we have an issue with the ios Source map.
We have followed the doc to integrate sentry, version 1.3.8 But we cannot see our artifacts.
our configuration is this: Sentry.init({ dsn: Config.SENTRY_KEY, environment: Config.ENV, release: packageJson.version + ‘+’ + BUILD_NUMBER, });
Could you support throw this issue?
On android we have fixed using this sentry.gradle: https://github.com/azundo/sentry-react-native/blob/8068c61c95074ff7f4393a4a4ec52d8196f7dfa9/sentry.gradle
@valeriashpiner @lukebars rewriting frames did not seem to work. Same as others I still get this error.
I have no clue what’s going on with our Sentry. We updated to 1.3.3.
IOS and Android don’t receive sourcemaps automatically through cli. Cli commands:

When I generated locally and push to Sentry, I see them in artifacts, but also I see that:
For android, we use v8 now.
@Swatinem @HazAT feel free to check: https://sentry.io/share/issue/e864e4c711d742eb834ad5742046006b/
I don’t understand why with the process which should be so easy, we struggle so much 😦
I tried:
RewriteFrames
as shown above.Sentry.init
calls on the top of App.js.init({ ... })
.Please, let me know, maybe we can write to support to help us maintain Sentry properly because the current situation influenced our crash reports and we can’t react fast.
We are facing issues with Sentry on Android with v8, without enabling Hermes.
I can confirm that the bundles are uploaded:
But the issue says that source code was not found:

Any idea how to solve this?
@valeriashpiner its not in your path I guess?
It is usually in
node_modules/hermes-engine/linux64-bin/hermes
or a different directory, depending on your OS.Same issue. Hmm, rollback to
1.2.2
not helped.