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:

  1. yarn add @sentry/react-native@latest
  2. pod install (it updated sentry/react-native to 1.3.0)
  3. 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. Screen Shot 2020-02-12 at 9 49 29 AM Screen Shot 2020-02-12 at 9 49 21 AM

I don’t see sourcemaps for android, but 1.3.0 sees Hermes engine. Screen Shot 2020-02-12 at 9 58 34 AM

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)

Most upvoted comments

Still doesn’t look too good.

The link I posted above looks like this:

    $ npx react-native bundle --platform android --entry-file input.js --bundle-output intermediate.js --sourcemap-output intermediate.js.map
    $ hermes -O -emit-binary -output-source-map -out=intermediate2 intermediate.js
    $ node react-native/scripts/compose-source-maps.js intermediate.js.map intermediate2.map -o output.map

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 a 0B 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’

@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 Zrzut ekranu 2020-05-8 o 09 41 44

and artifacts Zrzut ekranu 2020-05-8 o 09 42 43

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.

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 and Android on react-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. Screenshot 2020-05-14 at 09 34 49

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: Screen Shot 2020-03-13 at 4 02 18 PM Screen Shot 2020-03-13 at 4 02 23 PM

When I generated locally and push to Sentry, I see them in artifacts, but also I see that: Screen Shot 2020-03-13 at 4 00 02 PM

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:

  • Version 1.3.1 and 1.3.3
  • Use RewriteFrames as shown above.
  • My Sentry.init calls on the top of App.js.
  • My init({ ... }). Screen Shot 2020-03-13 at 4 05 06 PM

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: image

But the issue says that source code was not found: image image

Any idea how to solve this?

@Swatinem when I do hermes -O -emit-binary ... to create my bundles with Hermes I received bash: hermes: command not found 😦 Is it possible to install hermes globally or how to fix it?

@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.